From 47cb520b40e36faf82a5625a81628dcf173ab2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vlas=C3=A1k?= Date: Thu, 9 Jan 2020 20:20:28 +0100 Subject: [PATCH] feat: add auth check to CIReporter --- src/reporters/CIReporter.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/reporters/CIReporter.ts b/src/reporters/CIReporter.ts index 41d8f22ec..844d6b287 100644 --- a/src/reporters/CIReporter.ts +++ b/src/reporters/CIReporter.ts @@ -41,7 +41,13 @@ export class CIReporter implements IReporter { const reportString = this.buildReport(practicesAndComponents); this.d(reportString); - return this.postMessage(reportString); + return this.postMessage(reportString).catch((error) => { + this.d(error.message); + if (error.code === 401 || error.code === 404 || error.code === 403) { + return undefined; + } + throw error; + }); } buildReport(practicesAndComponents: PracticeWithContextForReporter[]): string {