mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-09 20:47:26 +00:00
catch
This commit is contained in:
parent
9429a7b9ad
commit
dd1d2966f2
2 changed files with 10 additions and 10 deletions
8
dist/index.js
vendored
8
dist/index.js
vendored
|
|
@ -14704,10 +14704,7 @@ var superagent = __nccwpck_require__(1524);
|
|||
// const {failCi} = buildExec();
|
||||
try {
|
||||
var filename_1 = __dirname + '/uploader';
|
||||
superagent.get('https://uploader.codecov.io/latest/codecov-linux')["catch"]('error', function (err) {
|
||||
core.setFailed('Codecov: Could not properly download uploader binary: ' +
|
||||
("" + err.message));
|
||||
})
|
||||
superagent.get('https://uploader.codecov.io/latest/codecov-linux')
|
||||
.pipe(fs.createWriteStream(filename_1))
|
||||
.then(function (err, res) {
|
||||
fs.chmodSync(filename_1, '777');
|
||||
|
|
@ -14724,6 +14721,9 @@ try {
|
|||
.then(function () {
|
||||
console.log('finished!');
|
||||
});
|
||||
})["catch"](function (err) {
|
||||
core.setFailed('Codecov: Could not properly download uploader binary: ' +
|
||||
("" + err.message));
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
|
|
|
|||
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…
Reference in a new issue