We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74de0dc commit bd9532aCopy full SHA for bd9532a
packages/npm-packages/ruby-wasm-wasi/src/index.ts
@@ -513,8 +513,13 @@ function wrapRbOperation<R>(vm: RubyVM, body: () => R): R {
513
try {
514
return body();
515
} catch (e) {
516
+ if (e instanceof RbError) {
517
+ throw e;
518
+ }
519
+ // All JS exceptions triggered by Ruby code are translated to Ruby exceptions,
520
+ // so non-RbError exceptions are unexpected.
521
+ vm.guest.rbVmBugreport();
522
if (e instanceof WebAssembly.RuntimeError && e.message === "unreachable") {
- vm.guest.rbVmBugreport();
523
const error = new RbError(`Something went wrong in Ruby VM: ${e}`);
524
error.stack = e.stack;
525
throw error;
0 commit comments