async Errors thrown from setTimeout code in content-scripts get lost

RESOLVED FIXED in mozilla28

Status

Add-on SDK
General
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: zombie, Assigned: zombie)

Tracking

unspecified
mozilla28

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
noticed while working on bug 689615. there are two parts to it:

1) errors thrown in setTimeout code aren't propagated to Worker.onError callback
2) Error instances can't transfer through a pipe because of JSONification

the second is confusing, and it shows up in several places, like bug 902965, comment 5 (console logging also goes through a JSON+pipe).

why do pipe messages between content and addon context even go through JSON?  it can't be for security (sandbox/compartments take care of that?), nor asynchronicity (pipes take care of that?), as evidenced by:

https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/content/worker.js#L369

which gets the access to the actual Error instance directly (or maybe cross-compartment wrapped, but not JSONified).
(Assignee)

Comment 1

5 years ago
Created attachment 830342 [details] [review]
link to PR 1285
Attachment #830342 - Flags: review?(jsantell)
Assignee: nobody → tomica+amo
Attachment #830342 - Flags: review?(jsantell) → review+

Comment 2

5 years ago
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/6619a0e4d4b9c1c0a3312551b274ad5dbf0e8825
Merge pull request #1285 from zombie/936962-async-onError

fix bug 936962 - propagate async Errors in content-scripts, r=@jsantell

Updated

5 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Assignee)

Updated

4 years ago
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.