feat: Draft implementation to store and expose integration errors

This commit is contained in:
Faruk AYDIN
2022-09-19 12:13:36 +03:00
parent d0bcf997fb
commit 8826125845
3 changed files with 47 additions and 21 deletions

View File

@@ -11,7 +11,12 @@ export default class HttpClient {
}
async get(path: string, options?: IJSONObject) {
return await this.instance.get(path, options);
try {
return await this.instance.get(path, options);
} catch (error) {
error.response.automatischError = error.response.data;
return error.response;
}
}
async post(path: string, body: IJSONObject | string, options?: IJSONObject) {