HomePhabricator
Diffusion Comm c2b8eac55a57

[WASM] improve error logging

Description

[WASM] improve error logging

Summary: Emscripten instead of errors returns to JS pointer to error. To get meaningful message we need to pass this pointer back to C++, read value from it and return error.what() as string.

Test Plan:

  1. Add this code auto x = SQLiteQueryExecutor::getStorage().get<Draft>("123"); and check if error from ORM is visible:

Screenshot 2023-12-19 at 11.07.18.png (298×938 px, 38 KB)

  1. Add this code throw std::runtime_error("TEST ERROR"); and check if error is visible:

Screenshot 2023-12-19 at 11.08.19.png (290×940 px, 38 KB)

  1. Use null pointer
  2. User not existing pointer

Reviewers: tomek, michal, marcin

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D10396

Details

Provenance
kamilAuthored on Dec 19 2023, 4:41 AM
Reviewer
tomek
Differential Revision
D10396: [WASM] improve error logging
Parents
rCOMM692ce23ca3c7: [web] don't log out user when processing draft store ops fails
Branches
Unknown
Tags
Unknown