Page MenuHomePhabricator

[WASM] improve error logging
ClosedPublic

Authored by kamil on Dec 19 2023, 4:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 4 2024, 5:33 AM
Unknown Object (File)
Feb 19 2024, 11:11 PM
Unknown Object (File)
Feb 19 2024, 10:59 PM
Unknown Object (File)
Feb 19 2024, 4:07 PM
Unknown Object (File)
Jan 25 2024, 10:42 AM
Unknown Object (File)
Jan 5 2024, 4:38 AM
Unknown Object (File)
Dec 31 2023, 5:05 PM
Unknown Object (File)
Dec 26 2023, 11:09 PM
Subscribers

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.

remove test compilation flags

kamil published this revision for review.Dec 19 2023, 5:14 AM
tomek added inline comments.
web/cpp/SQLiteQueryExecutorBindings.cpp
20 ↗(On Diff #34830)
This revision is now accepted and ready to land.Dec 19 2023, 6:23 AM
This revision was automatically updated to reflect the committed changes.