diff options
author | Liam <towerofnix@gmail.com> | 2017-01-07 18:26:02 -0400 |
---|---|---|
committer | Liam <towerofnix@gmail.com> | 2017-01-07 18:26:02 -0400 |
commit | 16da7fb310198851c2e4b02abedfb24979287242 (patch) | |
tree | d7546f7c1a3c3833e6450ea1e10af388f8848bb5 /exception.js |
Initial commit
Diffstat (limited to 'exception.js')
-rw-r--r-- | exception.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/exception.js b/exception.js new file mode 100644 index 0000000..e88ff99 --- /dev/null +++ b/exception.js @@ -0,0 +1,7 @@ +module.exports = function exception(code, message) { + // Makes a custom error with the given code and message. + + const err = new Error(`${code}: ${message}`) + err.code = code + return err +} |