From 6a0e957e1f2c9f5bea0882efbf2e0494cd5074fa Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 28 Sep 2024 17:54:13 +0200 Subject: loader: clean up connecterror * allow string values for public errors * remove unused errors * update naming --- adapter/protocol/file.nim | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'adapter/protocol/file.nim') 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() -- cgit 1.4.1-2-gfad0