summaryrefslogtreecommitdiff
path: root/source/github-helpers/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'source/github-helpers/api.ts')
-rw-r--r--source/github-helpers/api.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/github-helpers/api.ts b/source/github-helpers/api.ts
index e9ca80af..069f0197 100644
--- a/source/github-helpers/api.ts
+++ b/source/github-helpers/api.ts
@@ -72,7 +72,7 @@ export async function expectTokenScope(scope: string): Promise<void> {
const {headers} = await v3('/');
const tokenScopes = headers.get('X-OAuth-Scopes')!;
if (!tokenScopes.split(', ').includes(scope)) {
- throw new Error(`The token you provided does not have the \`${scope}\` scope. It only includes \`${tokenScopes}\``);
+ throw new Error('The token you provided does not have ' + (tokenScopes ? `the \`${scope}\` scope. It only includes \`${tokenScopes}\`.` : 'any scope.'));
}
}