get-detail-from-error
1.0.2 • Public • Published get-detail-from-error
Catching Errors
Result format
// for Error type
{
name: 'string', // error.name
stack: 'string', // error.stack
message: 'string' // error.message
}
// for AxiosError type
{
name: 'string', // error.name + error.code
endpoint: 'GET /api/fake/12345', // api called
messsage: 'string', // response.detail.message or response.message or error.message
status: 400, // response status code
response: { } // response data
}
Package Sidebar
Install
npm i get-detail-from-error
Weekly Downloads