pull/243/head
xiaojunnuo 2024-11-11 13:46:06 +08:00
parent 9fe5d6655c
commit 5d756eb54b
2 changed files with 4 additions and 1 deletions

View File

@ -65,7 +65,7 @@ class HttpError extends Error {
if (error.response) {
this.status = error.response.status;
this.statusText = error.response.statusText;
this.statusText = error.response.statusText || error.code;
this.response = {
data: error.response.data,
};

View File

@ -35,6 +35,9 @@ export class HttpError extends Error {
this.status = error.response?.status;
this.statusText = error.response?.statusText || error.code;
if (!this.message) {
this.message = error.code;
}
this.request = {
baseURL: error.config?.baseURL,
url: error.config?.url,