Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions packages/browser/src/eventbuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ export function extractType(ex: Error & { message: { error?: Error } }): string
export function extractMessage(ex: Error & { message: { error?: Error } }): string {
const message = ex?.message;

if (isWebAssemblyException(ex)) {
return 'wasm exception';
Copy link
Member Author

Choose a reason for hiding this comment

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

This failed on node versions > 18, also tested it in integration tests.
Decided to hardcode it, as opposed to ex.toString() which returns [object WebAssembly.Exception

}

if (!message) {
return 'No error message';
}
Expand All @@ -207,11 +211,6 @@ export function extractMessage(ex: Error & { message: { error?: Error } }): stri
return message.error.message;
}

// Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object
if (isWebAssemblyException(ex) && Array.isArray(ex.message) && ex.message.length == 2) {
Copy link
Member

Choose a reason for hiding this comment

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

should we leave this for legacy stuff? Not sure if/how relevant this is...

Copy link
Member Author

Choose a reason for hiding this comment

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

hm yeah I updated it to fallback to 'wasm exception' now

return ex.message[1];
}

return message;
}

Expand Down
Loading