Open Bug 1398394 Opened 7 years ago Updated 2 years ago

Containers api errors could be simplified with thrown exceptions

Categories

(WebExtensions :: General, enhancement, P5)

57 Branch
enhancement

Tracking

(firefox57 wontfix)

Tracking Status
firefox57 --- wontfix

People

(Reporter: jkt, Unassigned)

References

(Blocks 1 open bug)

Details

:kmag pointed out in https://bugzilla.mozilla.org/show_bug.cgi?id=1395659#c14 > I'd probably just make getContainerForCookieStoreId and getPublicIdentityFromId throw an ExtensionError for invalid IDs. Up to you, though. We can do this however these methods are used in other places that don't appear to handle thrown exceptions. On IRC he also said: > Are they used anywhere that we don't want them to throw? > If so, I'd just add a default value argument, and have them throw if it's not passed, return it if it is. Either way this would simplify the checks for `if (!containerId) {` in toolkit/components/extensions/ext-contextualIdentities.js
Priority: -- → P5
Product: Toolkit → WebExtensions
Assignee: jonathan → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.