TSLint: re-enable no-useless-catch rule

This commit is contained in:
glacambre 2019-04-04 13:03:31 +02:00
parent 4adc256d8a
commit 8b3b809417
No known key found for this signature in database
GPG key ID: B9625DB1767553AC
3 changed files with 14 additions and 32 deletions

View file

@ -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.

View file

@ -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
}
/**

View file

@ -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,