summaryrefslogtreecommitdiff
path: root/source/libs/utils.ts
diff options
context:
space:
mode:
authorGravatar Federico Brigante <opensource@bfred.it> 2020-04-15 00:31:22 +0200
committerGravatar GitHub <noreply@github.com> 2020-04-15 00:31:22 +0200
commitbf2a893741883572e7eb20c5f6d57d4ad43d6991 (patch)
tree461fd59f8028a9409b7029e4ae1cf6b1466037ca /source/libs/utils.ts
parent35303dc98eaab5eea46d8f9f2fb3afb48eb64bcf (diff)
downloadrefined-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.ts8
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(