summaryrefslogtreecommitdiff
path: root/source/libs/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'source/libs/utils.ts')
-rw-r--r--source/libs/utils.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/libs/utils.ts b/source/libs/utils.ts
index b8efa1b6..e5047015 100644
--- a/source/libs/utils.ts
+++ b/source/libs/utils.ts
@@ -3,10 +3,11 @@ import onetime from 'onetime';
import stripIndent from 'strip-indent';
import {isRepo, isPR, isIssue} from './page-detect';
-export function logError(featureName: typeof __featureName__, message: string, ...extras: unknown[]): void {
+export function logError(featureName: typeof __featureName__, error: Error | string, ...extras: unknown[]): void {
+ const message = typeof error === 'string' ? error : error.message;
// 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(`❌ Refined GitHub: feature \`${featureName}\`\n\n${message}`, ...extras, stripIndent(`
+ console.error(`❌ Refined GitHub: feature \`${featureName}\`\n\n`, error, ...extras, stripIndent(`
Search for open issues:
https://github.com/sindresorhus/refined-github/issues?q=is%3Aissue+${encodeURIComponent(message)}