mirror of
https://github.com/certd/certd.git
synced 2026-04-30 09:17:24 +08:00
chore:
This commit is contained in:
@@ -65,7 +65,7 @@ class HttpError extends Error {
|
|||||||
|
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
this.status = error.response.status;
|
this.status = error.response.status;
|
||||||
this.statusText = error.response.statusText;
|
this.statusText = error.response.statusText || error.code;
|
||||||
this.response = {
|
this.response = {
|
||||||
data: error.response.data,
|
data: error.response.data,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ export class HttpError extends Error {
|
|||||||
|
|
||||||
this.status = error.response?.status;
|
this.status = error.response?.status;
|
||||||
this.statusText = error.response?.statusText || error.code;
|
this.statusText = error.response?.statusText || error.code;
|
||||||
|
if (!this.message) {
|
||||||
|
this.message = error.code;
|
||||||
|
}
|
||||||
this.request = {
|
this.request = {
|
||||||
baseURL: error.config?.baseURL,
|
baseURL: error.config?.baseURL,
|
||||||
url: error.config?.url,
|
url: error.config?.url,
|
||||||
|
|||||||
Reference in New Issue
Block a user