atom-archive / xray

An experimental next-generation Electron-based text editor
MIT License
8.48k stars 235 forks source link

Improve error handling #168

Closed as-cii closed 5 years ago

as-cii commented 5 years ago

This pull request takes a pass at the WASM layer and addresses the following issues:

  1. When an error occurs in Memo, we return a proper instance of the JavaScript Error class instead of a string. (c79cb79)
  2. When an error occurs in Javascript, we will catch in Rust and try to report it back to JavaScript only if the error is an instance of Error. Otherwise, we will display an error saying that an error occurred but we couldn't understand what it was.
  3. Along the way, I upgraded wasm-bindgen from v0.2.25 to v0.2.29, which includes some important bugfixes.

/cc: @probablycorey @jasonrudolph