@rakered/errors

Convenient custom errors matching http status code

Usage no npm install needed!

<script type="module">
  import rakeredErrors from 'https://cdn.skypack.dev/@rakered/errors';
</script>

README

@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' }