1.0.4 • Published 5 years ago
axios-error v1.0.4
axios-error
Axios error wrapper that aim to provide clear error message to developers
Installation
npm i --save axios-erroror
yarn add axios-errorUsage
const AxiosError = require('axios-error');
// You can construct it from the error thrown by axios
const error = new AxiosError(errorThrownByAxios);
// Or with an custom error message
const error = new AxiosError(message, errorThrownByAxios);
// Or construct it from axios config, axios request and axios response
const error = new AxiosError(message, { config, request, response });Calling console.log on the error instance returns the formatted message. If you'd like to get the axios request, response, or config, you can still get them via the following keys on the error instance:
console.log(error); // formatted error message
console.log(error.stack); // error stack trace
console.log(error.config); // axios request config
console.log(error.request); // HTTP request
console.log(error.response); // HTTP response1.0.4
5 years ago
1.0.0
5 years ago
1.0.0-beta.27
5 years ago
1.0.0-beta.26
5 years ago
1.0.0-beta.24
5 years ago
0.7.18
6 years ago
0.7.17
6 years ago
1.0.0-beta.16
6 years ago
1.0.0-beta.3
6 years ago
1.0.0-beta.4
6 years ago
1.0.0-beta.5
6 years ago
1.0.0-beta.2
6 years ago
1.0.0-beta.1
6 years ago
1.0.0-alpha.2
6 years ago
1.0.0-alpha.0
6 years ago
0.8.1
6 years ago
0.8.0
6 years ago
0.8.0-alpha.7
6 years ago
0.7.11
7 years ago
0.7.8
7 years ago
0.7.7
7 years ago
0.7.6
7 years ago
0.7.4
7 years ago
0.7.0
8 years ago
0.7.0-rc.3
8 years ago
0.7.0-rc.2
8 years ago
0.7.0-rc.1
8 years ago
0.7.0-beta.5
8 years ago
0.7.0-beta.4
8 years ago
0.7.0-beta.3
8 years ago
0.7.0-beta.2
8 years ago
0.7.0-beta.1
8 years ago
0.7.0-alpha.2
8 years ago
0.5.4
8 years ago
0.5.2
8 years ago
0.5.0
8 years ago
0.5.0-0
8 years ago