npm.io
1.1.0 • Published 5 years ago

@rakered/errors

Licence
MIT
Version
1.1.0
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
31

@rakered/errors

Convenient custom errors matching http status code

social image

Usage

import { AuthenticationError } from '@rakered/errors';

throw new AuthenticationError('you need to be logged in');
// » { code: 401, message: 'you need to be logged in' }