Ticket #267 (closed defect: fixed)

Opened 8 months ago

Last modified 3 months ago

cabal upload has poor error messages (just an HTTP response code)

Reported by: guest Assigned to:
Priority: normal Milestone:
Component: cabal-install tool Version: HEAD
Severity: normal Keywords:
Cc: Difficulty: normal
GHC Version: 6.8.2 Platform:

Description

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.

Change History

04/09/08 17:16:03 changed 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.

(follow-up: ↓ 3 ) 04/09/08 17:20:30 changed by ross

OK, I can bypass outputError and send the plain text on request. Then cabal upload can stop ignoring it.

(in reply to: ↑ 2 ; follow-up: ↓ 4 ) 05/01/08 15:11:43 changed by duncan

Replying to 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

(in reply to: ↑ 3 ) 05/01/08 16:16:50 changed by ross

Replying to 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.

05/10/08 17:13:13 changed by ross

  • owner changed.
  • component changed from Cabal library to cabal-install tool.

08/12/08 11:14:38 changed by duncan

  • status changed from new to closed.
  • resolution set to fixed.

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 <lemmih@gmail.com>
  * Print upload error messages if they are in text/plain.