about summary refs log tree commit diff stats
path: root/adapter/protocol/file.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-09-28 17:54:13 +0200
committerbptato <nincsnevem662@gmail.com>2024-09-28 17:54:13 +0200
commit6a0e957e1f2c9f5bea0882efbf2e0494cd5074fa (patch)
tree3d6206a2bc8676d2fd913c3958e5186fc3375c2b /adapter/protocol/file.nim
parent9c257361388f5007871a36eea3abc815a8740d66 (diff)
downloadchawan-6a0e957e1f2c9f5bea0882efbf2e0494cd5074fa.tar.gz
loader: clean up connecterror
* allow string values for public errors
* remove unused errors
* update naming
Diffstat (limited to 'adapter/protocol/file.nim')
-rw-r--r--adapter/protocol/file.nim9
1 files changed, 1 insertions, 8 deletions
diff --git a/adapter/protocol/file.nim b/adapter/protocol/file.nim
index bd2c34a2..bf135180 100644
--- a/adapter/protocol/file.nim
+++ b/adapter/protocol/file.nim
@@ -4,7 +4,6 @@ import std/times
 
 import dirlist
 
-import loader/connecterror
 import utils/twtstr
 
 proc loadDir(path, opath: string) =
@@ -79,11 +78,6 @@ proc loadFile(f: File) =
       break
 
 proc main() =
-  if getEnv("MAPPED_URI_HOST") != "":
-    let code = int(ERROR_INVALID_URL)
-    stdout.write("Cha-Control: ConnectionError " & $code &
-      " cannot use host in file")
-    return
   let opath = getEnv("MAPPED_URI_PATH")
   let path = percentDecode(opath)
   var f: File
@@ -92,7 +86,6 @@ proc main() =
   elif dirExists(path):
     loadDir(path, opath)
   else:
-    let code = int(ERROR_FILE_NOT_FOUND)
-    stdout.write("Cha-Control: ConnectionError " & $code)
+    stdout.write("Cha-Control: ConnectionError FileNotFound")
 
 main()