ajax not processing 'on error' when htpcode is 400

0 favourites
  • 6 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • 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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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: dev.canvaramanager.com/vlt/api/api.php

    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.

  • 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.

  • Ashley,yes!,that is correct, the bug is that lastdata isnt set even though the request returns data.


  • 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?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)