mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 08:06:27 +00:00
Wrap request promise in try catch
This commit is contained in:
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2019 Codecov
|
Copyright (c) 2019-2020 Codecov
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
6
dist/index.js
vendored
6
dist/index.js
vendored
@@ -2236,6 +2236,7 @@ try {
|
|||||||
url: "https://codecov.io/bash",
|
url: "https://codecov.io/bash",
|
||||||
json: false
|
json: false
|
||||||
}, (error, response, body) => {
|
}, (error, response, body) => {
|
||||||
|
try {
|
||||||
if (error && fail_ci) {
|
if (error && fail_ci) {
|
||||||
throw error;
|
throw error;
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
@@ -2351,6 +2352,11 @@ try {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
core.setFailed(
|
||||||
|
`Codecov failed with the following error: ${error.message}`
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (fail_ci) {
|
if (fail_ci) {
|
||||||
|
|||||||
6
index.js
6
index.js
@@ -32,6 +32,7 @@ try {
|
|||||||
url: "https://codecov.io/bash",
|
url: "https://codecov.io/bash",
|
||||||
json: false
|
json: false
|
||||||
}, (error, response, body) => {
|
}, (error, response, body) => {
|
||||||
|
try {
|
||||||
if (error && fail_ci) {
|
if (error && fail_ci) {
|
||||||
throw error;
|
throw error;
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
@@ -147,6 +148,11 @@ try {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
core.setFailed(
|
||||||
|
`Codecov failed with the following error: ${error.message}`
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (fail_ci) {
|
if (fail_ci) {
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codecov-action",
|
"name": "codecov-action",
|
||||||
"version": "1.0.11",
|
"version": "1.0.12",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codecov-action",
|
"name": "codecov-action",
|
||||||
"version": "1.0.11",
|
"version": "1.0.12",
|
||||||
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user