The notifications module should handle errors on notify

RESOLVED FIXED in 1.0b2

Status

Add-on SDK
General
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: adw, Assigned: adw)

Tracking

unspecified
1.0b2

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Created attachment 502690 [details] [diff] [review]
patch

I've been looking at the notifications module after bug 624562.  When the module is loaded, it try-catches the alerts service getter, and that catches the case where Growl is not installed.  However, when Growl is installed but not running, the alerts service getter works fine, but this error occurs on the call to showAlertNotification:

[Exception... "Component returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]"  nsresult: "0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE)"  location: "JS frame :: resource://jid0-83qahhf3dde04ob6bpbidvvwvxg-api-utils-lib/securable-module.js -> resource://jid0-83qahhf3dde04ob6bpbidvvwvxg-addon-kit-lib/notifications.js :: <TOP_LEVEL> :: line 47"  data: no]

I assume other platforms may fail in the same ways, and in any case the module should handle platform errors as best it can.  This patch retreats to the plain text console if necessary.

Also, the doc should explain what platforms are supported and what happens when the user's platform is not supported.
Attachment #502690 - Flags: review?(myk)
Comment on attachment 502690 [details] [diff] [review]
patch

Looks good, r=myk!
Attachment #502690 - Flags: review?(myk) → review+
(Assignee)

Comment 2

7 years ago
https://github.com/mozilla/addon-sdk/commit/aea6cf369b30fe000715c494a6d718399dd3ba49
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0b2
You need to log in before you can comment on or make changes to this bug.