Closed Bug 1094485 Opened 10 years ago Closed 10 years ago

Properly handle exceptions in readerWorker.js

Categories

(Firefox for Android Graveyard :: Reader View, defect)

35 Branch
All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 36

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file)

Right now if there's a JS exception in readerWorker.js, we just eat it and never get back to Reader.js with a response. In the case of _downloadAndParseDocument, this means we'll never release a loaded <browser> from memory.
Adding an onerror handler will make sure that we can handle JS exceptions in the worker.

I looked through the promise chains, and a rejection here will be caught and logged upstream. However, I realized that our getArticle in _addTabToReadingList expects that null will be returned, not an exception thrown, if there's a problem getting the article, so I decided to make getArticle handle the exception itself.
Attachment #8517805 - Flags: review?(bnicholson)
Comment on attachment 8517805 [details] [diff] [review]
Properly handle exceptions in readerWorker.js

Review of attachment 8517805 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, thanks for fixing this!
Attachment #8517805 - Flags: review?(bnicholson) → review+
https://hg.mozilla.org/mozilla-central/rev/f2237c6455ab
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: