Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Bad exception when trying to extract a null body. #4

Closed
sbtourist opened this Issue Sep 26, 2010 · 11 comments

Comments

Projects
None yet
2 participants

When trying to extract a response body with the "string" function, it fails if the body is null as follows:

java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.CharSequence

Even if extracting a null body may be an illegal operation, the above exception doesn't make the problem clear for the user.

By looking at your latest sources, I honestly don't get why it's giving that exception: maybe it's something you fixed in the latest snapshot version?

Collaborator

neotyk commented Sep 26, 2010

By response with null body you mean empty body, right?

I mean the server doesn't return anything.

Collaborator

neotyk commented Sep 26, 2010

Anything?
Status line?
Headers?

Collaborator

neotyk commented Sep 26, 2010

I've fixed situation where no message body was delivered, response is done, and you want to use h.a.c/string or even h.a.c/body.
Hopefully it fixes your issue: neotyk@27a6c1183b9817dfb2ee9af29c577c194b70d34f

Great: so did you succeed to reproduce the bug in your test? Out of curiosity, what caused that odd exception?

Collaborator

neotyk commented Sep 27, 2010

I didn't manage to reproduce it :(
Though I found another issue, which was following:
If response was finished, and no body was delivered both string and body would wait infinitely for delivery of body.
And that is what I have solved.

No worries: I'm adding sonatype repositories to leiningen, so that I can make the master working and try to reproduce it.
Stay tuned.

Collaborator

neotyk commented Sep 27, 2010

Pull from master, repository is already there.

Collaborator

neotyk commented Oct 19, 2010

Is it still a bug for you, I can't reproduce it.

Can't reproduce this anymore: will eventually reopen if able to reproduce.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment