ajax not processing 'on error' when htpcode is 400

Bugs will be moved here once resolved.

Post » Wed Nov 06, 2013 7:38 pm



Steps to reproduce:
1. make a ajax get request to a rest service that responds with httpcode 400
2. watch the code freeze and not go to on error method


Observed result:
not entering method

Expected result:
on error triggered

Browsers affected:
Firefox: yes


Operating system & service pack:
win xp serv pack 2
Construct 2 version:
    rel 146
B
9
S
2
Posts: 76
Reputation: 709

Post » Wed Nov 06, 2013 9:18 pm

Can you provide a .capx that reproduces the problem? The AJAX plugin is coded to fire 'On error' if the HTTP response code is greater or equal to 400, so it should still fire when it is 400. Also note we do not support Windows XP SP2, only SP3.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,351

Post » Thu Nov 07, 2013 8:19 am

sorry, I do use sp3 did a typo.

I may have been wrong it might trigger on error but it does not get the ajax.lastdata if there is an httpcode of 400.(the browser continues to read the same url,but maybe this is not ok for ajax?

what my rest is doing:
if you dot send correct in data it will give an httpcode of 400 and output the error message in xml, as this: https://dev.canvaramanager.com/vlt/api/api.php?rquest=login_device&gw_id=2&device_id=%20&output=xml

now i want construct to atleast return the lastdata so i can properly display an error message,
yeah i know i can remove the setting of httpcode from the rest api but then i would violate best practices of rest.
B
9
S
2
Posts: 76
Reputation: 709

Post » Thu Nov 07, 2013 5:27 pm

So the actual bug is lastdata is not set if the HTTP error code is 400? I've changed the plugin to still set lastdata in this case, so hopefully the next build fixes it.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,351

Post » Thu Nov 07, 2013 7:28 pm

@ashley,yes!,that is correct, the bug is that lastdata isnt set even though the request returns data.
Thanks!
B
9
S
2
Posts: 76
Reputation: 709

Post » Wed Jan 22, 2014 5:54 pm

this bug still hasnt been rectified?
i doenloaded latest release (152) but the behavior is the same.
while im at it im also wondering about the JSON plugin timeframe?
B
9
S
2
Posts: 76
Reputation: 709


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests