From 769413468e88acba1a180baa0113139d929a3b9f Mon Sep 17 00:00:00 2001 From: liam4 Date: Mon, 3 Jul 2017 18:59:57 -0300 Subject: A long-due cleanup + examples + things ..Obviously this breaks old things (particularly, see changes in FocusElement). --- util/exception.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 util/exception.js (limited to 'util/exception.js') diff --git a/util/exception.js b/util/exception.js new file mode 100644 index 0000000..e88ff99 --- /dev/null +++ b/util/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 +} -- cgit 1.3.0-6-gf8a5