[drakma-devel] misleading error message

Hello list, I've just found out that the following call to HTTP-REQUEST: (http-request "http://some.secret/uri" :method :post :parameters '(("TextField"))) yields the following error (very confusing, especially if the HTTP-REQUEST is buried deep on the call stack and its arguments are not outright visible) against Drakma 0.11.3: Illegal argument to file-namestring: NIL. [Condition of type TYPE-ERROR] This is because the cdr of one of the parameters (here, the only one) is nil, so it gets catched by the last OR clause in the last COND clause in DRAKMA::MAKE-FORM-DATA-FUNCTION, which causes the spurious error. Would it be possible to reformulate the message so that it's more clear what happened? Best regards, -- Daniel Janus <daniel@sentivision.com>

On Friday 08 February 2008 18:09:24 Daniel Janus wrote:
On Friday 08 February 2008 18:06:12 Edi Weitz wrote:
Would it be possible to reformulate the message so that it's more clear what happened?
Sure. Wanna send a patch?
I should be able to on Monday.
Actually, I found a few more minutes and came up with the attached patch, which changes the error to "Don't know what to do with NIL in multipart/form-data body.". -- Daniel Janus <daniel@sentivision.com> Senior Software Engineer, SENTIVISION Mb: +48.501180396 | Ph: +48.226400860

On Fri, 8 Feb 2008 18:24:58 +0100, Daniel Janus <daniel@sentivision.com> wrote:
Actually, I found a few more minutes and came up with the attached patch, which changes the error to "Don't know what to do with NIL in multipart/form-data body.".
That's not entirely correct - you have to check for the CAR, not for the CDR. But I've now uploaded a version which hopefully has better error messages for cases like this one (and others as well). Thanks, Edi.
participants (2)
-
Daniel Janus
-
Edi Weitz