diff --git a/opcua-core/src/lib.rs b/opcua-core/src/lib.rs index a4b28a32..14f8ad6e 100644 --- a/opcua-core/src/lib.rs +++ b/opcua-core/src/lib.rs @@ -64,7 +64,6 @@ pub mod constants { pub mod comms; pub mod config; -pub mod errors; pub mod handle; pub mod messages; diff --git a/opcua-types/Cargo.toml b/opcua-types/Cargo.toml index ce212027..c654fbe6 100644 --- a/opcua-types/Cargo.toml +++ b/opcua-types/Cargo.toml @@ -35,7 +35,6 @@ struson = { workspace = true, optional = true } opcua-xml = { path = "../opcua-xml", optional = true } - [dev-dependencies] opcua-types = { path = ".", features = ["xml", "json"] } serde_json = { workspace = true } diff --git a/opcua-core/src/errors.rs b/opcua-types/src/errors.rs similarity index 71% rename from opcua-core/src/errors.rs rename to opcua-types/src/errors.rs index 6c9a854c..8f4c05f8 100644 --- a/opcua-core/src/errors.rs +++ b/opcua-types/src/errors.rs @@ -3,15 +3,19 @@ //! Rust OpcUa specific errors -use opcua_types::VariantScalarTypeId; use thiserror::Error; +use crate::VariantScalarTypeId; + /// Rust OpcUa specific errors #[allow(missing_docs)] #[derive(Error, Debug)] pub enum OpcUAError { #[error("Received an unexpected variant type")] - UnexpectedVariantType(Option), + UnexpectedVariantType { + variant_id: Option, + message: String, + }, #[error("The requested namespace does not exists")] NamespaceDoesNotExist(String), } diff --git a/opcua-types/src/lib.rs b/opcua-types/src/lib.rs index 5beb7ebe..f06fec03 100644 --- a/opcua-types/src/lib.rs +++ b/opcua-types/src/lib.rs @@ -250,6 +250,7 @@ pub mod data_value; pub mod date_time; pub mod diagnostic_info; pub mod encoding; +pub mod errors; pub mod event_field; pub mod expanded_node_id; pub mod extension_object;