Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/02c343872feee40970b204eae6799b5deefbf6bd

>---------------------------------------------------------------

commit 02c343872feee40970b204eae6799b5deefbf6bd
Author: Lemmih <[email protected]>
Date:   Sun Aug 10 10:36:07 2008 +0000

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

>---------------------------------------------------------------

 cabal-install/Distribution/Client/Upload.hs |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cabal-install/Distribution/Client/Upload.hs 
b/cabal-install/Distribution/Client/Upload.hs
index 856998c..608ee9d 100644
--- a/cabal-install/Distribution/Client/Upload.hs
+++ b/cabal-install/Distribution/Client/Upload.hs
@@ -20,7 +20,7 @@ import Network.Browser
          , Authority(..), addAuthority, setAuthorityGen
          , setOutHandler, setErrHandler, setProxy )
 import Network.HTTP
-         ( Header(..), HeaderName(..)
+         ( Header(..), HeaderName(..), findHeader
          , Request(..), RequestMethod(..), Response(..) )
 import Network.URI (URI(uriPath), parseURI)
 
@@ -123,7 +123,9 @@ handlePackage verbosity uri auth path =
        (x,y,z) -> do notice verbosity $ "ERROR: " ++ path ++ ": " 
                                      ++ map intToDigit [x,y,z] ++ " "
                                      ++ 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 path = 



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to