on master help sign in
report more information when registry fetches get bad data
d7153e7Evan Czaplicki
builder/src/Deps/Registry.hs+5−2
@@ -193,11 +193,14 @@ getVersions' name (Registry _ versions) =
193
193
194post :: Http.Manager -> String -> D.Decoder x a -> (a -> IO b) -> IO (Either Exit.RegistryProblem b)
194post :: Http.Manager -> String -> D.Decoder x a -> (a -> IO b) -> IO (Either Exit.RegistryProblem b)
195post manager path decoder callback =
195post manager path decoder callback =
196+ let
196− Http.post manager (Website.route path []) [] Exit.RP_Http $
197+ url = Website.route path []
198+ in
199+ Http.post manager url [] Exit.RP_Http $
197 \body ->
200 \body ->
198 case D.fromByteString decoder body of
201 case D.fromByteString decoder body of
199 Right a -> Right <$> callback a
202 Right a -> Right <$> callback a
200− Left _ -> return $ Left Exit.RP_Data
203+ Left _ -> return $ Left $ Exit.RP_Data url body
201
204
202
205
203
206