Daniel Janus | 8 Feb 2008 17:50

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 <at> sentivision.com>
Edi Weitz | 8 Feb 2008 18:06
Picon
Favicon

Re: misleading error message

On Fri, 8 Feb 2008 17:50:56 +0100, Daniel Janus <daniel <at> sentivision.com> wrote:

> Would it be possible to reformulate the message so that it's more
> clear what happened?

Sure.  Wanna send a patch?

Edi.
Daniel Janus | 8 Feb 2008 18:09

Re: misleading error message

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. 

Best,
--

-- 
Daniel Janus <daniel <at> sentivision.com>
Daniel Janus | 8 Feb 2008 18:24

Re: misleading error message

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 <at> sentivision.com>
Senior Software Engineer, SENTIVISION
Mb: +48.501180396 | Ph: +48.226400860
Attachment (drakma.patch): text/x-diff, 646 bytes
_______________________________________________
drakma-devel mailing list
drakma-devel <at> common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
Edi Weitz | 13 Feb 2008 16:25
Picon
Favicon

New release 0.11.4 (Was: misleading error message)

On Fri, 8 Feb 2008 18:24:58 +0100, Daniel Janus <daniel <at> 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.

Gmane