added try - catch in api and handleError methods

This commit is contained in:
Adina Parpalita
2019-10-22 13:14:57 +03:00
parent 227e05e3f9
commit e8ed183a44
13 changed files with 201 additions and 189 deletions

View File

@@ -48,4 +48,12 @@ export abstract class RepoApi {
return this.username;
}
protected handleError(message: string, response: any) {
console.log(`\n--- ${message} error :`);
console.log('\t>>> Status: ', response.status);
console.log('\t>>> Text: ', response.response.text);
console.log('\t>>> Method: ', response.response.error.method);
console.log('\t>>> Path: ', response.response.error.path);
}
}