get-detail-from-error

1.0.2 • Public • Published

get-detail-from-error

Publish Package to npmjs npm version

Catching Errors

  • Axios Error
  • Error

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
}

Readme

Keywords

Package Sidebar

Install

npm i get-detail-from-error

Weekly Downloads

36

Version

1.0.2

License

ISC

Unpacked Size

40 kB

Total Files

8

Last publish

Collaborators

  • erodrigues-dev