no handler for data problem again

Jan 21, 2013 at 12:21 PM
Edited Jan 21, 2013 at 12:21 PM

Hey guys,


I have also the problem with DELETE batch requests that I get no handler for data error in datajs 1.0.3

According to the spec for a DELETE request:

If the DeleteEntity Request was successful, the response MUST have a 204 (No Content) status code, as specified in [RFC2616].

I analyzed a bit and found out that in the default Handler code:

if (response && assigned(response.body) && response.headers["Content-Type"]) {
dispatchHandler("read", response, context);

the assigned function doesn't check if the body is an empty string which is the case from the server response : response.body = "".

So the dispatchHandler function is called which tries to parse the response where there is no one.

Is this a bug...Shouldn't be also checked if the repsonse body is an empty string..e.g. if (response.body)?



Feb 5, 2013 at 4:48 PM
Hi Joe82,

It seems that it's a bug in the current version, you can do a work around by changing the version you are working on to check if response.body ="", and we'll work on fixing the bug in the next release.

Feb 11, 2013 at 8:46 AM
Hi nomier,

Thank you very much. I added this fix temporarily and looking forward for the next version :D