From d3f8134f28ff5a8d5211a056f6a56f42cdb5e91a Mon Sep 17 00:00:00 2001 From: Sven Eberth Date: Wed, 18 Dec 2024 03:18:36 +0100 Subject: [PATCH] Revert "feat: added error handler" This reverts commit acc2a94dc572b30321fbccba87f61b0345f51776. This does not work with AbortErrors. It yields `undefined`. No clue what's the point of this --- src/HttpClient.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/HttpClient.js b/src/HttpClient.js index 95dee0d..3387092 100644 --- a/src/HttpClient.js +++ b/src/HttpClient.js @@ -75,9 +75,6 @@ function request(url, {json, method, params, ...customConfig} = {}) { const errorMessage = `${response.status} ${response.statusText}: ${response.headers.get('x-viur-error')}` return Promise.reject(new HTTPError(response.status, response.statusText, errorMessage, response)) } - }).catch((error) => { - const errorMessage = `${error.statusCode} ${error.statusText}: ${error.response.headers.get('x-viur-error')}` - return Promise.reject(new HTTPError(error.statusCode, error.statusText, errorMessage, error)) }) }