Skip to content

Commit 792d3b2

Browse files
Report Exception#message instead of Exception#to_s
Because some of libraries override `Exception#message` rather than `Exception#to_s` and `Exception#message` by default returns `Exception#to_s` if it's not overridden. So it's better to report `Exception#message`.
1 parent 5c52a15 commit 792d3b2

File tree

1 file changed

+1
-1
lines changed
  • packages/npm-packages/ruby-wasm-wasi/src

1 file changed

+1
-1
lines changed

packages/npm-packages/ruby-wasm-wasi/src/vm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ class RbExceptionFormatter {
602602
}
603603

604604
try {
605-
message = error.toString();
605+
message = error.call("message").toString();
606606
} catch (e) {
607607
message = "unknown";
608608
}

0 commit comments

Comments
 (0)