From 779734303b22ad8266183f4942a11d42bbba04d9 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Thu, 14 Jan 2021 10:20:44 +0100 Subject: [PATCH] Improve error for suspended app --- .../integration/src/github/GithubCredentialsProvider.test.ts | 2 +- packages/integration/src/github/GithubCredentialsProvider.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/integration/src/github/GithubCredentialsProvider.test.ts b/packages/integration/src/github/GithubCredentialsProvider.test.ts index 1bf5a11b9b..a272714887 100644 --- a/packages/integration/src/github/GithubCredentialsProvider.test.ts +++ b/packages/integration/src/github/GithubCredentialsProvider.test.ts @@ -198,7 +198,7 @@ describe('GithubCredentialsProvider tests', () => { github.getCredentials({ url: 'https://github.com/backstage', }), - ).rejects.toThrow('The app for backstage is suspended'); + ).rejects.toThrow('The GitHub application for backstage is suspended'); }); it('should return the default token when the call to github return a status that is not recognized', async () => { diff --git a/packages/integration/src/github/GithubCredentialsProvider.ts b/packages/integration/src/github/GithubCredentialsProvider.ts index a1f21d0e69..c572dd3473 100644 --- a/packages/integration/src/github/GithubCredentialsProvider.ts +++ b/packages/integration/src/github/GithubCredentialsProvider.ts @@ -80,7 +80,9 @@ class GithubAppManager { } = await this.getInstallationData(owner); if (suspended) { throw new Error( - `The app for ${[owner, repo].filter(Boolean).join('/')} is suspended`, + `The GitHub application for ${[owner, repo] + .filter(Boolean) + .join('/')} is suspended`, ); }