Skip to content

Commit

Permalink
Merge pull request #3277 from Bravo555/refactor/2-operations-loading
Browse files Browse the repository at this point in the history
refactor: Extract `supported_operations` module from `c8y_api`
  • Loading branch information
Bravo555 authored Dec 3, 2024
2 parents 985c980 + 71a68b1 commit 98b0f1d
Show file tree
Hide file tree
Showing 11 changed files with 1,110 additions and 1,110 deletions.
22 changes: 0 additions & 22 deletions crates/core/c8y_api/src/smartrest/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::io;
use std::path::PathBuf;

// allowing large size difference between variants warning,
// because the enum `SmartRestSerializerError` is already Boxed
Expand Down Expand Up @@ -44,27 +43,6 @@ pub enum SmartRestDeserializerError {
NoResponse,
}

#[derive(Debug, thiserror::Error)]
pub enum OperationsError {
#[error("Failed to read directory: {dir}")]
ReadDirError { dir: PathBuf },

#[error(transparent)]
FromIo(#[from] std::io::Error),

#[error("Cannot extract the operation name from the path: {0}")]
InvalidOperationName(PathBuf),

#[error("Error while parsing operation file: '{0}': {1}.")]
TomlError(PathBuf, #[source] toml::de::Error),

#[error(transparent)]
FromUtf8Error(#[from] std::string::FromUtf8Error),

#[error(transparent)]
FromMqttError(#[from] mqtt_channel::MqttError),
}

#[derive(thiserror::Error, Debug)]
pub enum SMCumulocityMapperError {
#[error("Invalid MQTT Message.")]
Expand Down
1 change: 0 additions & 1 deletion crates/core/c8y_api/src/smartrest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pub mod csv;
pub mod error;
pub mod inventory;
pub mod message;
pub mod operations;
pub mod payload;
pub mod smartrest_deserializer;
pub mod smartrest_serializer;
Expand Down
Loading

0 comments on commit 98b0f1d

Please sign in to comment.