diff --git a/ts/smartswagger.classes.smartswagger.ts b/ts/smartswagger.classes.smartswagger.ts index c45f4bc..98099c0 100644 --- a/ts/smartswagger.classes.smartswagger.ts +++ b/ts/smartswagger.classes.smartswagger.ts @@ -123,7 +123,12 @@ export class Smartswagger { headers: { 'accept-encoding': 'application/json', }, + }).catch(err => { + console.log(err); }); + if (!documentResponse || documentResponse.status > 299) { + return; + } const documentString = await documentResponse.text(); const apiDoc: IExtendedApiDoc = JSON.parse(documentString); console.log(`document successfully fetched!`);