mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
sends 404s if we can't find the package rather than just blowing up and going 500
This commit is contained in:
@@ -75,7 +75,9 @@ getAppR file = do
|
||||
`orThrow` sendResponseStatus status404 (NotFoundE [i|#{pkg} satisfying #{versionSpec}|])
|
||||
addPackageHeader pkg version
|
||||
void $ recordMetrics pkg version
|
||||
(len, src) <- getPackage pkg version
|
||||
(len, src) <- getPackage pkg version >>= \case
|
||||
Nothing -> sendResponseStatus status404 ([i|#{pkg}@#{version} not found|] :: Text)
|
||||
Just a -> pure a
|
||||
addHeader "Content-Length" (show len)
|
||||
respondSource typeOctet $ src .| awaitForever sendChunkBS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user