add check for directory existence during package version enumeration (#80)

* add check for directory existence during package version enumeration

* cleanup

* error consistency

* errmsg cleanup
This commit is contained in:
Keagan McClelland
2021-11-23 16:33:35 -07:00
parent eb7b777cf0
commit 7b402d4039
2 changed files with 13 additions and 7 deletions

View File

@@ -76,7 +76,7 @@ getAppR file = do
addPackageHeader pkg version
void $ recordMetrics pkg version
(len, src) <- getPackage pkg version >>= \case
Nothing -> sendResponseStatus status404 ([i|#{pkg}@#{version} not found|] :: Text)
Nothing -> sendResponseStatus status404 (NotFoundE [i|#{pkg}@#{version}|])
Just a -> pure a
addHeader "Content-Length" (show len)
respondSource typeOctet $ src .| awaitForever sendChunkBS