Skip to content

propagateExceptionFinalResort implementation for wasm-js and js confusing users #4451

Open
@bashor

Description

@bashor

Both implementations call console.error and pass exception.toString(), which is basically a name of Exception class + message. In addition, console.error prints a stack trace from a call site (not from the exception!!), which users often consider a stack trace from the exception (example).

In this project, you can find a project with a simple repro and possible improvements implemented via CoroutineExceptionHandler.

I think #1 or any other way to rethrow the exception is the best option since there are standard ways inside JS runtimes to process unhandled exceptions. These might be used directly or by some library intended to handle problems on a page. In the worst case, a browser (runtime) will show the error in a standard and more convenient way.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions