Skip to content

Commit cfe7a98

Browse files
committed
scripts
build: fail download of OpenAPI specs if response is a 404
1 parent 957b78a commit cfe7a98

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/download.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ function download(version, fileName) {
6868

6969
return new Promise((resolve, reject) => {
7070
get(url, (response) => {
71+
if (response.statusCode !== 200) {
72+
throw new Error(`Not Found: ${url}`);
73+
}
74+
7175
response.pipe(file);
7276
file
7377
.on("finish", () =>

0 commit comments

Comments
 (0)