mirror of
https://github.com/codecov/codecov-action.git
synced 2026-04-13 01:20:06 +00:00
catch
This commit is contained in:
parent
9429a7b9ad
commit
dd1d2966f2
2 changed files with 10 additions and 10 deletions
12
src/index.ts
12
src/index.ts
|
|
@ -12,12 +12,6 @@ const superagent = require('superagent');
|
|||
try {
|
||||
const filename = __dirname + '/uploader';
|
||||
superagent.get('https://uploader.codecov.io/latest/codecov-linux')
|
||||
.catch('error', (err) => {
|
||||
core.setFailed(
|
||||
'Codecov: Could not properly download uploader binary: ' +
|
||||
`${err.message}`,
|
||||
);
|
||||
})
|
||||
.pipe(fs.createWriteStream(filename))
|
||||
.then((err, res) => {
|
||||
fs.chmodSync(filename, '777');
|
||||
|
|
@ -37,6 +31,12 @@ try {
|
|||
.then(() => {
|
||||
console.log('finished!');
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
core.setFailed(
|
||||
'Codecov: Could not properly download uploader binary: ' +
|
||||
`${err.message}`,
|
||||
);
|
||||
});
|
||||
} catch (err) {
|
||||
core.setFailed(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue