about summary refs log tree commit diff stats
path: root/src/js/exception.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/exception.nim')
-rw-r--r--src/js/exception.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/js/exception.nim b/src/js/exception.nim
index 1550d431..f30c4898 100644
--- a/src/js/exception.nim
+++ b/src/js/exception.nim
@@ -31,6 +31,11 @@ const NamesTable = {
 type DOMException* = ref object of JSError
   name* {.jsget.}: string
 
+type
+  JSResult*[T] = Result[T, JSError]
+
+  DOMResult*[T] = Result[T, DOMException]
+
 proc newDOMException*(message = "", name = "Error"): DOMException {.jsctor.} =
   return DOMException(
     e: JS_DOM_EXCEPTION,