fix(document from url): now listens to fix reaction to bad responses
This commit is contained in:
parent
d540431158
commit
cf7709576a
@ -123,7 +123,12 @@ export class Smartswagger {
|
|||||||
headers: {
|
headers: {
|
||||||
'accept-encoding': 'application/json',
|
'accept-encoding': 'application/json',
|
||||||
},
|
},
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err);
|
||||||
});
|
});
|
||||||
|
if (!documentResponse || documentResponse.status > 299) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const documentString = await documentResponse.text();
|
const documentString = await documentResponse.text();
|
||||||
const apiDoc: IExtendedApiDoc = JSON.parse(documentString);
|
const apiDoc: IExtendedApiDoc = JSON.parse(documentString);
|
||||||
console.log(`document successfully fetched!`);
|
console.log(`document successfully fetched!`);
|
||||||
|
Loading…
Reference in New Issue
Block a user