about summary refs log tree commit diff stats
path: root/src/xhr/xmlhttprequest.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-11 19:39:56 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-11 19:39:56 +0100
commitb7570a38b70059fbb9a3fb3d32df153ad5f9706f (patch)
tree0bcb774fd862afa92944268636d11d3b08f0cd7b /src/xhr/xmlhttprequest.nim
parent091764fd976831e0b6d86f4e364dceb4e9c1114f (diff)
downloadchawan-b7570a38b70059fbb9a3fb3d32df153ad5f9706f.tar.gz
Use errDOMException template everywhere
Diffstat (limited to 'src/xhr/xmlhttprequest.nim')
-rw-r--r--src/xhr/xmlhttprequest.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xhr/xmlhttprequest.nim b/src/xhr/xmlhttprequest.nim
index 38576b2b..7b1d535f 100644
--- a/src/xhr/xmlhttprequest.nim
+++ b/src/xhr/xmlhttprequest.nim
@@ -74,16 +74,16 @@ proc parseMethod(s: string): DOMResult[HttpMethod] =
   of "post": ok(HTTP_POST)
   of "put": ok(HTTP_PUT)
   of "connect", "trace", "track":
-    err(newDOMException("Forbidden method", "SecurityError"))
+    errDOMException("Forbidden method", "SecurityError")
   else:
-    err(newDOMException("Invalid method", "SyntaxError"))
+    errDOMException("Invalid method", "SyntaxError")
 
 proc open(this: XMLHttpRequest, httpMethod, url: string): Err[DOMException]
     {.jsfunc.} =
   let httpMethod = ?parseMethod(httpMethod)
   let x = parseURL(url)
   if x.isNone:
-    return err(newDOMException("Invalid URL", "SyntaxError"))
+    return errDOMException("Invalid URL", "SyntaxError")
   let parsedURL = x.get
   #TODO async, username, password arguments
   let async = true