diff --git a/.changes/fs-improve-error-message.md b/.changes/fs-improve-error-message.md new file mode 100644 index 00000000..3ceb0ec6 --- /dev/null +++ b/.changes/fs-improve-error-message.md @@ -0,0 +1,5 @@ +--- +"fs": patch +--- + +Fix promise rejection error only containing the context and stripping the actual error message. diff --git a/plugins/fs/src/commands.rs b/plugins/fs/src/commands.rs index 59255796..ac0893a7 100644 --- a/plugins/fs/src/commands.rs +++ b/plugins/fs/src/commands.rs @@ -36,7 +36,11 @@ impl Serialize for CommandError { where S: Serializer, { - serializer.serialize_str(self.to_string().as_ref()) + if let Self::Anyhow(err) = self { + serializer.serialize_str(format!("{err:#}").as_ref()) + } else { + serializer.serialize_str(self.to_string().as_ref()) + } } }