refactor: catch doesn't need to have a param (no-changelog) (#5614)
This commit is contained in:
committed by
GitHub
parent
9420b0fdf8
commit
4e244937c9
@@ -88,7 +88,7 @@ export const executeCommand = async (
|
||||
|
||||
try {
|
||||
await fsAccess(downloadFolder);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
await fsMkdir(downloadFolder);
|
||||
// Also init the folder since some versions
|
||||
// of npm complain if the folder is empty
|
||||
@@ -154,7 +154,7 @@ export function matchMissingPackages(
|
||||
return parsedPackageData.packageName;
|
||||
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
return undefined;
|
||||
});
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ const isJsonRequest = (curlJson: CurlJson): boolean => {
|
||||
try {
|
||||
JSON.parse(bodyKey);
|
||||
return true;
|
||||
} catch (_) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ export class LoadNodesAndCredentials implements INodesAndCredentials {
|
||||
const removeCommand = `npm remove ${packageName}`;
|
||||
try {
|
||||
await executeCommand(removeCommand);
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
|
||||
throw new Error(RESPONSE_ERROR_MESSAGES.PACKAGE_DOES_NOT_CONTAIN_NODES);
|
||||
}
|
||||
@@ -284,7 +284,7 @@ export class LoadNodesAndCredentials implements INodesAndCredentials {
|
||||
const removeCommand = `npm remove ${packageName}`;
|
||||
try {
|
||||
await executeCommand(removeCommand);
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
throw new Error(RESPONSE_ERROR_MESSAGES.PACKAGE_DOES_NOT_CONTAIN_NODES);
|
||||
}
|
||||
}
|
||||
@@ -418,7 +418,7 @@ export class LoadNodesAndCredentials implements INodesAndCredentials {
|
||||
await fsAccess(checkPath);
|
||||
// Folder exists, so use it.
|
||||
return path.dirname(checkPath);
|
||||
} catch (_) {} // Folder does not exist so get next one
|
||||
} catch {} // Folder does not exist so get next one
|
||||
}
|
||||
throw new Error('Could not find "node_modules" folder!');
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export const validCredentialType = (
|
||||
): express.Response | void => {
|
||||
try {
|
||||
Container.get(CredentialTypes).getByName(req.body.type);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
return res.status(400).json({ message: 'req.body.type is not a known type' });
|
||||
}
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ nodesController.get(
|
||||
if (missingPackages) {
|
||||
hydratedPackages = matchMissingPackages(hydratedPackages, missingPackages);
|
||||
}
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// Do nothing if setting is missing
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class TranslationController {
|
||||
async getNodeTranslationHeaders() {
|
||||
try {
|
||||
await access(`${NODE_HEADERS_PATH}.js`);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
return; // no headers available
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ function makeUpdateParams(fetchedWorkflows: PinData.FetchedWorkflow[]) {
|
||||
if (typeof rawPinData === 'string') {
|
||||
try {
|
||||
pinDataPerWorkflow = JSON.parse(rawPinData);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
pinDataPerWorkflow = {};
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -132,7 +132,7 @@ export class MessageEventBusDestinationWebhook
|
||||
let encryptionKey: string | undefined;
|
||||
try {
|
||||
encryptionKey = await UserSettings.getEncryptionKey();
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
if (encryptionKey) {
|
||||
this.credentialsHelper = new CredentialsHelper(encryptionKey);
|
||||
}
|
||||
@@ -189,7 +189,7 @@ export class MessageEventBusDestinationWebhook
|
||||
// query is specified using JSON
|
||||
try {
|
||||
JSON.parse(this.jsonQuery);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
console.log('JSON parameter need to be an valid JSON');
|
||||
}
|
||||
this.axiosRequestOptions.params = jsonParse(this.jsonQuery);
|
||||
@@ -207,7 +207,7 @@ export class MessageEventBusDestinationWebhook
|
||||
// body is specified using JSON
|
||||
try {
|
||||
JSON.parse(this.jsonHeaders);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
console.log('JSON parameter need to be an valid JSON');
|
||||
}
|
||||
this.axiosRequestOptions.headers = jsonParse(this.jsonHeaders);
|
||||
@@ -302,27 +302,27 @@ export class MessageEventBusDestinationWebhook
|
||||
if (this.genericAuthType === 'httpBasicAuth') {
|
||||
try {
|
||||
httpBasicAuth = await this.matchDecryptedCredentialType('httpBasicAuth');
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
} else if (this.genericAuthType === 'httpDigestAuth') {
|
||||
try {
|
||||
httpDigestAuth = await this.matchDecryptedCredentialType('httpDigestAuth');
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
} else if (this.genericAuthType === 'httpHeaderAuth') {
|
||||
try {
|
||||
httpHeaderAuth = await this.matchDecryptedCredentialType('httpHeaderAuth');
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
} else if (this.genericAuthType === 'httpQueryAuth') {
|
||||
try {
|
||||
httpQueryAuth = await this.matchDecryptedCredentialType('httpQueryAuth');
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
} else if (this.genericAuthType === 'oAuth1Api') {
|
||||
try {
|
||||
oAuth1Api = await this.matchDecryptedCredentialType('oAuth1Api');
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
} else if (this.genericAuthType === 'oAuth2Api') {
|
||||
try {
|
||||
oAuth2Api = await this.matchDecryptedCredentialType('oAuth2Api');
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user