diff options
author | bptato <nincsnevem662@gmail.com> | 2024-01-11 19:39:56 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-01-11 19:39:56 +0100 |
commit | b7570a38b70059fbb9a3fb3d32df153ad5f9706f (patch) | |
tree | 0bcb774fd862afa92944268636d11d3b08f0cd7b /src/xhr/xmlhttprequest.nim | |
parent | 091764fd976831e0b6d86f4e364dceb4e9c1114f (diff) | |
download | chawan-b7570a38b70059fbb9a3fb3d32df153ad5f9706f.tar.gz |
Use errDOMException template everywhere
Diffstat (limited to 'src/xhr/xmlhttprequest.nim')
-rw-r--r-- | src/xhr/xmlhttprequest.nim | 6 |
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 |