Commit bb14b56d authored by David Himmelstrup's avatar David Himmelstrup
Browse files

Print upload error messages if they are in text/plain.

parent 822c4bb1
...@@ -20,7 +20,7 @@ import Network.Browser ...@@ -20,7 +20,7 @@ import Network.Browser
, Authority(..), addAuthority, setAuthorityGen , Authority(..), addAuthority, setAuthorityGen
, setOutHandler, setErrHandler, setProxy ) , setOutHandler, setErrHandler, setProxy )
import Network.HTTP import Network.HTTP
( Header(..), HeaderName(..) ( Header(..), HeaderName(..), findHeader
, Request(..), RequestMethod(..), Response(..) ) , Request(..), RequestMethod(..), Response(..) )
import Network.URI (URI(uriPath), parseURI) import Network.URI (URI(uriPath), parseURI)
...@@ -123,7 +123,9 @@ handlePackage verbosity uri auth path = ...@@ -123,7 +123,9 @@ handlePackage verbosity uri auth path =
(x,y,z) -> do notice verbosity $ "ERROR: " ++ path ++ ": " (x,y,z) -> do notice verbosity $ "ERROR: " ++ path ++ ": "
++ map intToDigit [x,y,z] ++ " " ++ map intToDigit [x,y,z] ++ " "
++ rspReason resp ++ rspReason resp
debug verbosity $ rspBody resp case findHeader HdrContentType resp of
Just "text/plain" -> notice verbosity $ rspBody resp
_ -> debug verbosity $ rspBody resp
mkRequest :: URI -> FilePath -> IO Request mkRequest :: URI -> FilePath -> IO Request
mkRequest uri path = mkRequest uri path =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment