[Hackage] #267: cabal upload has poor error messages (just an HTTP response code)

#267: cabal upload has poor error messages (just an HTTP response code) ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: | ----------------------------+----------------------------------------------- All these bugs are against the homeomorphic library I have written. To play along, you can do darcs get --partial http://www.cs.york.ac.uk/fp/darcs/homeomorphic $ cabal upload dist E:\Neil\homeomorphic>cabal upload dist\homeomorphic-0.1.tar.gz Hackage username: NeilMitchell Hackage password: yoda Uploading dist\homeomorphic-0.1.tar.gz... ERROR: dist\homeomorphic-0.1.tar.gz: 400 Error in upload 400 error in upload - not the worlds most helpful error message... Duncan says: Indeed. There is an error message available but I'm not sure how we get at it. Any ideas Ross? Another ticket for this one. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/267 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#267: cabal upload has poor error messages (just an HTTP response code) ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by ross): The CGI script uses `outputError`, which returns a response with a status header ''400 Error in upload'', with the error message (in HTML) in the body. Cabal upload is presumably ignoring the message because it wants plain text, but the CGI library doesn't offer that. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/267#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#267: cabal upload has poor error messages (just an HTTP response code) ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by ross): OK, I can bypass outputError and send the plain text on request. Then cabal upload can stop ignoring it. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/267#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#267: cabal upload has poor error messages (just an HTTP response code) ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Replying to [comment:2 ross]:
OK, I can bypass outputError and send the plain text on request. Then cabal upload can stop ignoring it.
That'd be great. At the moment we're sending `Accept: text/plain` and getting `Content- Type: text/html; charset=ISO-8859-1` as a response. As a note to whoever wants to do the client-side change in future: inspect {{{ [ s | Header HdrContentType s <- rspHeaders resp ] }}} to see if it starts with `"text/plain"` and if so print the `rspBody resp` -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/267#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#267: cabal upload has poor error messages (just an HTTP response code) ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by ross): Replying to [comment:3 duncan]:
At the moment we're sending `Accept: text/plain` and getting `Content- Type: text/html; charset=ISO-8859-1` as a response.
That is done by `outputError` in the cgi package. Björn Bringert is rewriting `outputError` and friends to check HTTP_ACCEPT and send the error messages as text/plain if requested. When that's done, the server side will require only a recompile. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/267#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#267: cabal upload has poor error messages (just an HTTP response code)
---------------------------------+------------------------------------------
Reporter: guest | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: cabal-install tool | Version: HEAD
Severity: normal | Resolution: fixed
Keywords: | Difficulty: normal
Ghcversion: 6.8.2 | Platform:
---------------------------------+------------------------------------------
Changes (by duncan):
* status: new => closed
* resolution: => fixed
Comment:
cabal-install now reports error messages if the server returns them using
mime type `text/plain`.
{{{
Sun Aug 10 11:36:07 BST 2008 Lemmih
participants (1)
-
Hackage