aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/shirabe/src/json/json_file.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs
index da6370e4..feb72764 100644
--- a/crates/shirabe/src/json/json_file.rs
+++ b/crates/shirabe/src/json/json_file.rs
@@ -171,8 +171,6 @@ impl JsonFile {
})() {
Ok(j) => j,
Err(e) => {
- // TransportException keeps its message verbatim; any other exception is wrapped
- // with the "Could not read" prefix.
if let Some(te) = e.catch::<TransportException>() {
let message = te.get_message().to_string();
return Err(RuntimeException::with_code_and_previous(
@@ -182,6 +180,10 @@ impl JsonFile {
)
.into());
}
+ // `catch (\Exception)` leaves an \Error to propagate.
+ if e.is_instanceof::<shirabe_php_shim::Error>() {
+ return Err(e);
+ }
return Err(RuntimeException::new(format!(
"Could not read {}\n\n{}",
self.path, e