initial commit
[squeep-indie-auther] / src / errors.js
diff --git a/src/errors.js b/src/errors.js
new file mode 100644 (file)
index 0000000..9f4cb2b
--- /dev/null
@@ -0,0 +1,21 @@
+'use strict';
+
+const { Errors } = require('@squeep/api-dingus');
+
+/**
+ * A stack-less exception for general data issues.
+ */
+class ValidationError extends Error {
+  constructor(...args) {
+    super(...args);
+    delete this.stack;
+  }
+
+  get name() {
+    return this.constructor.name;
+  }
+}
+module.exports = {
+  ...Errors,
+  ValidationError,
+};
\ No newline at end of file