UNPKG
@femto-apps/errors
Version:
latest (2.0.0)
2.0.0
1.0.0
A simple JavaScript library to handle errors in APIs
github.com/femto-apps/errors
femto-apps/errors
@femto-apps/errors
/
examples
/
basic.js
11 lines
(7 loc)
•
253 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
Errors
=
require
(
'../'
)(
'errors.json'
)
function
test
(
) {
const
error =
Errors
(
'ERR_CONSUMER_SAVE'
, {
file
:
'test.txt'
})
console
.
log
(error
instanceof
Error
)
throw
Errors
(
'ERR_CONSUMER_SAVE'
, {
file
:
'test.txt'
}) }
test
()