diff options
author | 2020-04-15 00:31:22 +0200 | |
---|---|---|
committer | 2020-04-15 00:31:22 +0200 | |
commit | bf2a893741883572e7eb20c5f6d57d4ad43d6991 (patch) | |
tree | 461fd59f8028a9409b7029e4ae1cf6b1466037ca /source/libs/utils.ts | |
parent | 35303dc98eaab5eea46d8f9f2fb3afb48eb64bcf (diff) | |
download | refined-github-bf2a893741883572e7eb20c5f6d57d4ad43d6991.tar.gz refined-github-bf2a893741883572e7eb20c5f6d57d4ad43d6991.tar.zst refined-github-bf2a893741883572e7eb20c5f6d57d4ad43d6991.zip |
Improve feature loading mechanism (#2987)
Diffstat (limited to 'source/libs/utils.ts')
-rw-r--r-- | source/libs/utils.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/libs/utils.ts b/source/libs/utils.ts index 68ff552b..364c271d 100644 --- a/source/libs/utils.ts +++ b/source/libs/utils.ts @@ -4,8 +4,14 @@ import stripIndent from 'strip-indent'; import {isRepo, isPR, isIssue} from './page-detect'; import compareVersions from 'tiny-version-compare'; -export function logError(featureName: typeof __featureName__, error: Error | string, ...extras: unknown[]): void { +export function logError(featureName: FeatureName, error: Error | string, ...extras: unknown[]): void { const message = typeof error === 'string' ? error : error.message; + + if (message.includes('token')) { + console.log(`âšī¸ Refined GitHub â ${featureName} â`, message); + return; + } + // Don't change this to `throw Error` because Firefox doesn't show extensions' errors in the console. // Use `return` after calling this function. console.error( |