fix all cases of lint rule
This commit is contained in:
parent
639b8970f9
commit
4a6e1b7192
|
@ -8,6 +8,7 @@ module.exports = {
|
|||
node.callee.object.name === "console" &&
|
||||
node.callee.property.name === "error" &&
|
||||
node.arguments.length === 1 &&
|
||||
node.arguments[0].name &&
|
||||
node.arguments[0].name.startsWith("err")
|
||||
) {
|
||||
context.report({
|
||||
|
|
|
@ -64,7 +64,6 @@ async function refreshOIDCAccessToken(
|
|||
}
|
||||
strategy = await oidc.strategyFactory(enrichedConfig, ssoSaveUserNoOp)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
throw new Error("Could not refresh OAuth Token")
|
||||
}
|
||||
|
||||
|
@ -99,7 +98,6 @@ async function refreshGoogleAccessToken(
|
|||
ssoSaveUserNoOp
|
||||
)
|
||||
} catch (err: any) {
|
||||
console.error(err)
|
||||
throw new Error(
|
||||
`Error constructing OIDC refresh strategy: message=${err.message}`
|
||||
)
|
||||
|
|
|
@ -138,7 +138,6 @@ export default function (
|
|||
} catch (err: any) {
|
||||
authenticated = false
|
||||
console.error(`Auth Error: ${err.message}`)
|
||||
console.error(err)
|
||||
// remove the cookie as the user does not exist anymore
|
||||
clearCookie(ctx, Cookie.Auth)
|
||||
}
|
||||
|
@ -187,7 +186,6 @@ export default function (
|
|||
}
|
||||
} catch (err: any) {
|
||||
console.error(`Auth Error: ${err.message}`)
|
||||
console.error(err)
|
||||
// invalid token, clear the cookie
|
||||
if (err?.name === "JsonWebTokenError") {
|
||||
clearCookie(ctx, Cookie.Auth)
|
||||
|
|
|
@ -12,7 +12,7 @@ export async function errorHandling(ctx: any, next: any) {
|
|||
if (status >= 400 && status < 500) {
|
||||
console.warn(err)
|
||||
} else {
|
||||
console.error(err)
|
||||
console.error("Got 400 response code", err)
|
||||
}
|
||||
|
||||
let error: APIError = {
|
||||
|
|
|
@ -68,7 +68,6 @@ export async function strategyFactory(
|
|||
verify
|
||||
)
|
||||
} catch (err: any) {
|
||||
console.error(err)
|
||||
throw new Error(`Error constructing google authentication strategy: ${err}`)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,7 +103,6 @@ export async function strategyFactory(
|
|||
strategy.name = "oidc"
|
||||
return strategy
|
||||
} catch (err: any) {
|
||||
console.error(err)
|
||||
throw new Error(`Error constructing OIDC authentication strategy - ${err}`)
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +141,6 @@ export async function fetchStrategyConfig(
|
|||
callbackURL: callbackUrl,
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
throw new Error(
|
||||
`Error constructing OIDC authentication configuration - ${err}`
|
||||
)
|
||||
|
|
|
@ -26,7 +26,6 @@ export const getMigrationsDoc = async (db: any) => {
|
|||
if (err.status && err.status === 404) {
|
||||
return { _id: DocumentType.MIGRATIONS }
|
||||
} else {
|
||||
console.error(err)
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ function writeFile(output: any, filename: string) {
|
|||
console.log(`Wrote spec to ${path}`)
|
||||
return path
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
console.error("Error writing spec file", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ class OracleIntegration extends Sql implements DatasourcePlus {
|
|||
try {
|
||||
await connection.close()
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
console.error("Error connecting to Oracle", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ export const checkDevelopmentEnvironment = () => {
|
|||
error = "Must run via yarn once to generate environment."
|
||||
}
|
||||
if (error) {
|
||||
console.error(error)
|
||||
console.error("Error during development environment check", error)
|
||||
process.exit(-1)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue