2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

fix(core): add the missed implementation of AxiosError#status property; (#6573)

This commit is contained in:
Dmitriy Mozgovoy
2024-08-23 15:58:38 +03:00
committed by GitHub
parent 7004707c41
commit 6700a8adac
2 changed files with 10 additions and 2 deletions
+5 -2
View File
@@ -27,7 +27,10 @@ function AxiosError(message, code, config, request, response) {
code && (this.code = code);
config && (this.config = config);
request && (this.request = request);
response && (this.response = response);
if (response) {
this.response = response;
this.status = response.status ? response.status : null;
}
}
utils.inherits(AxiosError, Error, {
@@ -47,7 +50,7 @@ utils.inherits(AxiosError, Error, {
// Axios
config: utils.toJSONObject(this.config),
code: this.code,
status: this.response && this.response.status ? this.response.status : null
status: this.status
};
}
});