Skip to content

Commit

Permalink
Merge pull request #2373 from Ruadhri17/config-plugin-error-fix
Browse files Browse the repository at this point in the history
Fix ambiguous failure reason in uploader
  • Loading branch information
reubenmiller authored Oct 26, 2023
2 parents c2107d9 + 77e62aa commit 492c7f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/common/upload/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[derive(Debug, thiserror::Error)]
pub enum UploadError {
#[error("{context}")]
#[error("{context} {source}")]
Io {
context: String,
source: std::io::Error,
Expand Down
8 changes: 4 additions & 4 deletions crates/extensions/tedge_config_manager/src/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl ConfigManagerActor {
.insert(topic.name.clone(), ConfigOperation::Snapshot(request));
}
Err(error) => {
let error_message = format!("Handling of operation failed with {}", error);
let error_message = format!("Handling of operation failed with: {}", error);
request.failed(&error_message);
error!("{}", error_message);
self.publish_command_status(topic, &ConfigOperation::Snapshot(request))
Expand Down Expand Up @@ -231,7 +231,7 @@ impl ConfigManagerActor {
.await?;
}
Err(err) => {
let error_message = format!("Handling of operation failed with {}", err);
let error_message = format!("Handling of operation failed with: {}", err);
request.failed(&error_message);
error!("{}", error_message);
self.publish_command_status(&topic, &ConfigOperation::Snapshot(request))
Expand All @@ -254,7 +254,7 @@ impl ConfigManagerActor {
.insert(topic.name.clone(), ConfigOperation::Update(request));
}
Err(error) => {
let error_message = format!("Handling of operation failed with {}", error);
let error_message = format!("Handling of operation failed with: {}", error);
request.failed(&error_message);
error!("{}", error_message);
self.publish_command_status(topic, &ConfigOperation::Update(request))
Expand Down Expand Up @@ -307,7 +307,7 @@ impl ConfigManagerActor {
.await?;
}
Err(err) => {
let error_message = format!("Handling of operation failed with {}", err);
let error_message = format!("Handling of operation failed with: {}", err);
request.failed(&error_message);
error!("{}", error_message);
self.publish_command_status(&topic, &ConfigOperation::Update(request))
Expand Down
2 changes: 1 addition & 1 deletion crates/extensions/tedge_config_manager/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ async fn request_config_snapshot_that_does_not_exist() -> Result<(), anyhow::Err
mqtt.recv().await,
Some(MqttMessage::new(
&config_topic,
r#"{"status":"failed","reason":"Handling of operation failed with The requested config_type type_five is not defined in the plugin configuration file.","tedgeUrl":"http://127.0.0.1:3000/tedge/file-transfer/main/config-snapshot/type_five-1234","type":"type_five"}"#
r#"{"status":"failed","reason":"Handling of operation failed with: The requested config_type type_five is not defined in the plugin configuration file.","tedgeUrl":"http://127.0.0.1:3000/tedge/file-transfer/main/config-snapshot/type_five-1234","type":"type_five"}"#
).with_retain())
);

Expand Down

1 comment on commit 492c7f4

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
341 0 3 341 100 58m27.203999999s

Please sign in to comment.