diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-14 01:41:47 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-14 02:01:21 +0200 |
commit | c1b8338045716b25d664c0b8dd91eac0cb76480e (patch) | |
tree | a9c0a6763f180c2b6dd380aa880253ffc7685d85 /src/loader/connecterror.nim | |
parent | db0798acccbedcef4b16737f6be0cf7388cc0528 (diff) | |
download | chawan-c1b8338045716b25d664c0b8dd91eac0cb76480e.tar.gz |
move around more modules
* ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
Diffstat (limited to 'src/loader/connecterror.nim')
-rw-r--r-- | src/loader/connecterror.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/loader/connecterror.nim b/src/loader/connecterror.nim new file mode 100644 index 00000000..d2af5762 --- /dev/null +++ b/src/loader/connecterror.nim @@ -0,0 +1,18 @@ +import bindings/curl + +type ConnectErrorCode* = enum + ERROR_INVALID_DATA_URL = (-7, "invalid data URL") + ERROR_ABOUT_PAGE_NOT_FOUND = (-6, "about page not found") + ERROR_FILE_NOT_FOUND = (-5, "file not found") + ERROR_SOURCE_NOT_FOUND = (-4, "clone source could not be found"), + ERROR_LOADER_KILLED = (-3, "loader killed during transfer"), + ERROR_DISALLOWED_URL = (-2, "url not allowed by filter"), + ERROR_UNKNOWN_SCHEME = (-1, "unknown scheme") + +converter toInt*(code: ConnectErrorCode): int = + return int(code) + +func getLoaderErrorMessage*(code: int): string = + if code < 0: + return $ConnectErrorCode(code) + return $curl_easy_strerror(CURLcode(cint(code))) |