chore: Check for http error status codes including 400
This commit is contained in:
1 file changed
+1
-1
@@ -33,7 +33,7 @@ const downloadArtifact = (version) => {
|
||||
const artifactPath = path.resolve(tmpDir, artifactFileName);
|
||||
console.log('Download artifact url: ', url);
|
||||
https.get(url, (response) => {
|
||||
if (response.statusCode > 400) reject('Could not access artifact url.');
|
||||
if (response.statusCode >= 400) reject('Could not access artifact url.');
|
||||
const stream = response.pipe(fs.createWriteStream(artifactPath));
|
||||
stream.on('close', () => resolve(artifactPath));
|
||||
stream.on('error', reject);
|
||||
|
||||
Reference in new issue
Block a user