diff --git a/src/excmds.ts b/src/excmds.ts index 741fc664..7b445a9e 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -2396,13 +2396,9 @@ export async function containerdelete(name: string) { //#background export async function containerupdate(name: string, uname: string, ucolor: string, uicon: string) { logger.debug("containerupdate parameters: " + name + ", " + uname + ", " + ucolor + ", " + uicon) - try { - let containerId = await Container.fuzzyMatch(name) - let containerObj = Container.fromString(uname, ucolor, uicon) - await Container.update(containerId, containerObj) - } catch (e) { - throw e - } + let containerId = await Container.fuzzyMatch(name) + let containerObj = Container.fromString(uname, ucolor, uicon) + await Container.update(containerId, containerObj) } /** Shows a list of the current containers in Firefox's native JSON viewer in the current tab. diff --git a/src/lib/containers.ts b/src/lib/containers.ts index 5f55808c..0d21e643 100644 --- a/src/lib/containers.ts +++ b/src/lib/containers.ts @@ -57,12 +57,8 @@ export async function create( `[Container.create] container already exists, aborting.`, ) } else { - try { - let res = await browser.contextualIdentities.create(container) - return res.cookieStoreId - } catch (e) { - throw e - } + let res = await browser.contextualIdentities.create(container) + return res.cookieStoreId } } @@ -71,13 +67,9 @@ export async function create( */ export async function remove(name: string) { logger.debug(name) - try { - let id = await getId(name) - let res = await browser.contextualIdentities.remove(id) - logger.debug("[Container.remove] removed container:", res.cookieStoreId) - } catch (e) { - throw e - } + let id = await getId(name) + let res = await browser.contextualIdentities.remove(id) + logger.debug("[Container.remove] removed container:", res.cookieStoreId) } /** Updates the specified container. @@ -154,16 +146,12 @@ export function fromString( icon: string, id: string = "", ) { - try { - return { - name: name, - color: color as browser.contextualIdentities.IdentityColor, - icon: icon as browser.contextualIdentities.IdentityIcon, - cookieStoreId: id, - } as browser.contextualIdentities.ContextualIdentity // rules are made to be broken - } catch (e) { - throw e - } + return { + name: name, + color: color as browser.contextualIdentities.IdentityColor, + icon: icon as browser.contextualIdentities.IdentityIcon, + cookieStoreId: id, + } as browser.contextualIdentities.ContextualIdentity // rules are made to be broken } /** diff --git a/tslint.json b/tslint.json index 0cb7c09b..af08a4ea 100644 --- a/tslint.json +++ b/tslint.json @@ -28,8 +28,6 @@ "no-trailing-whitespace": false, "no-unnecessary-initializer": false, "no-unsafe-finally": false, - "no-useless-catch": false, - "no-useless-catch": false, "no-var-keyword": false, "no-variable-usage-before-declaration": false, "object-literal-key-quotes": false,