3.1.1 • Published 5 years ago

@scienceai/create-error v3.1.1

Weekly downloads
1
License
AGPL-3.0-or-later
Repository
github
Last release
5 years ago

create-error

CircleCI

styled with prettier

Create an error with a code property

import createError from '@scienceai/create-error';

createError();
createError(404);
createError('not found');
createError(404, 'not found');

Automatically handle CouchDB and API responses (from request or XHR)

import createError from '@scienceai/create-error';
import request from 'request';

request('http://example.com/couchdb', (err, resp, body) => {
  if (err = createError(err, resp, body)) {
    return callback(err);
  }

  // no error, we can process body
});
3.1.1

5 years ago

3.1.0

6 years ago

3.0.2

7 years ago

3.0.0

7 years ago

2.1.0

7 years ago

2.0.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.0

8 years ago