Closed
Bug 1157754
Opened 10 years ago
Closed 10 years ago
ErrorResult should provide method to dispose of JS exception in addition to clearing message
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: bkelly, Assigned: bzbarsky)
References
Details
Attachments
(3 files, 4 obsolete files)
2.76 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
4.02 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
2.78 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
We currently have a fair amount of code that calls ErrorResult::ClearMessage() after artificially consuming an ErrorResult in c++ code. For example, if the code converts to nsresult with ErrorCode() or in dom/cache where ErrorResult is passed over IPC.
On IRC Boris suggested we should really be checking for JS exceptions in these cases as well. So lets add a new method to do that.
Reporter | ||
Comment 1•10 years ago
|
||
Another case where ClearMessage() is used is when the error is effectively ignored, but the API in use requires an ErrorResult.
![]() |
Assignee | |
Comment 2•10 years ago
|
||
Attachment #8596646 -
Flags: review?(peterv)
![]() |
Assignee | |
Updated•10 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
![]() |
Assignee | |
Comment 3•10 years ago
|
||
Attachment #8596648 -
Flags: review?(bkelly)
![]() |
Assignee | |
Comment 4•10 years ago
|
||
Attachment #8596649 -
Flags: review?(peterv)
![]() |
Assignee | |
Comment 5•10 years ago
|
||
Attachment #8596655 -
Flags: review?(peterv)
![]() |
Assignee | |
Updated•10 years ago
|
Attachment #8596646 -
Attachment is obsolete: true
Attachment #8596646 -
Flags: review?(peterv)
![]() |
Assignee | |
Comment 6•10 years ago
|
||
Attachment #8596656 -
Flags: review?(bkelly)
![]() |
Assignee | |
Updated•10 years ago
|
Attachment #8596648 -
Attachment is obsolete: true
Attachment #8596648 -
Flags: review?(bkelly)
![]() |
Assignee | |
Comment 7•10 years ago
|
||
Attachment #8596682 -
Flags: review?(peterv)
![]() |
Assignee | |
Updated•10 years ago
|
Attachment #8596655 -
Attachment is obsolete: true
Attachment #8596655 -
Flags: review?(peterv)
Reporter | ||
Comment 8•10 years ago
|
||
Comment on attachment 8596656 [details] [diff] [review]
part 2. Convert consumers of ErrorResult::ClearMessage() to the new better APIs we have for suppressing exceptions on ErrorResult
Review of attachment 8596656 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/cache/FetchPut.cpp
@@ +160,5 @@
> MOZ_ASSERT(!mListener);
> mManager->RemoveListener(this);
> mManager->ReleaseCacheId(mCacheId);
> + mResult.SuppressException(); // XXXbz should we really be ending up here with
> + // a failed mResult we never reported to anyone?
This is going away in bug 1120501.
@@ +389,5 @@
> ErrorResult headerRv;
> nsAutoCString value;
> requestHeaders->Get(header, value, headerRv);
> if (NS_WARN_IF(headerRv.Failed())) {
> + headerRv.SuppressException();
This will remain after bug 1120501, but will require me to rebase. :-\
Attachment #8596656 -
Flags: review?(bkelly) → review+
![]() |
Assignee | |
Comment 9•10 years ago
|
||
I can wait for you to land bug 1120501 if you prefer. It's not like this bug has all its reviews yet anyway.
![]() |
Assignee | |
Comment 10•10 years ago
|
||
Attachment #8597009 -
Flags: review?(peterv)
![]() |
Assignee | |
Updated•10 years ago
|
Attachment #8596682 -
Attachment is obsolete: true
Attachment #8596682 -
Flags: review?(peterv)
Updated•10 years ago
|
Attachment #8597009 -
Flags: review?(peterv) → review+
Updated•10 years ago
|
Attachment #8596649 -
Flags: review?(peterv) → review+
Comment 11•10 years ago
|
||
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a03d304acdb3
https://hg.mozilla.org/mozilla-central/rev/c944fc7df692
https://hg.mozilla.org/mozilla-central/rev/4b8a27223558
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•