From f4f02c39f8732befc5f0db6185ec03e4d2a703e1 Mon Sep 17 00:00:00 2001 From: GP Date: Wed, 26 Feb 2020 10:07:26 +0530 Subject: [PATCH] main: Better error/warning messages on download failure - fixes #98 --- src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index acacd843..7fae8afa 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { platform } from 'os'; import { createWriteStream } from 'fs'; import fetch from 'node-fetch'; -import { debug, error, setFailed, getInput } from '@actions/core'; +import { debug, error, setFailed, getInput, warning } from '@actions/core'; import { exec } from '@actions/exec'; import { ExecOptions } from '@actions/exec/lib/interfaces'; @@ -65,6 +65,8 @@ export function run( } catch (err) { error(err.message); setFailed('🚨 CC Reporter download failed!'); + warning(`Could not download ${downloadUrl}`); + warning(`Please check if your platform is supported — see https://docs.codeclimate.com/docs/configuring-test-coverage#section-locations-of-pre-built-binaries`); return reject(err); } const execOpts: ExecOptions = {