Skip to content

Commit

Permalink
main: Better error/warning messages on download failure - fixes #98
Browse files Browse the repository at this point in the history
  • Loading branch information
paambaati committed Feb 26, 2020
1 parent 8f42562 commit f4f02c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit f4f02c3

Please sign in to comment.