Report more detailed errors in the mozStorage Rust binding
Categories
(Core :: SQLite and Embedded Database Bindings, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox68 | --- | fixed |
People
(Reporter: lina, Assigned: lina)
References
Details
Attachments
(1 file)
Currently, all the Rust storage methods return nsresults, which are super generic. NS_ERROR_FAILURE can mean a SQL syntax error, exceeding the binding param limit (ahem bug 1539691), an invalid column name, an error in a function call, an error in a trigger...
Running Firefox with env MOZ_LOG=timestamp,mozStorage:5 ./firefox turns on mozStorage logging, but we also want to write more detailed errors into Sync logs, and make them available in Sync telemetry for analysis.
| Assignee | ||
Comment 1•6 years ago
|
||
The nsresult codes that mozStorage returns are often too generic. For
example, NS_ERROR_FAILURE might be anything from a SQL syntax error
to an invalid column name in a trigger.
This commit adds a Conn::call_and_wrap_error helper that checks the
last SQLite error, and returns that instead of nsresult. Not all
errors are SQLite errors, however, so we only use this for mozStorage
methods that return convertResultCode.
Comment 3•6 years ago
|
||
| bugherder | ||
Updated•1 year ago
|
Description
•