Closed Bug 1731801 Opened 4 months ago Closed 3 months ago

Allow ToResult to return other nsresult like error types

Categories

(Core :: MFBT, task, P2)

task

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: janv, Assigned: janv)

Details

Attachments

(1 file)

ToResult now returns Result<Ok, nsresult>. Storage related modules (dom/quota, dom/indexedDB, etc.) now use QM_TRY with Result<V, E> quite extensively. We would like to incrementally switch from nsresult to QMResult, because QMResult can be used to create exact error stacks from telemetry data.

So we need a way for ToResult (also for ToResultInvoke, but that will be handled in a separate bug) to return QMResult instead of nsresult.

We could fork ToResult, which is quite simple, but we also need to use QMResult with ToResultInvoke and forking that would duplicate quite big amount of code.

Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ce2fa188418b
Allow ToResult to return other nsresult like error types; r=glandium
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.