1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

handling xenforo javascript error for curl response

Discussion in 'XenForo Development Discussions' started by Jarvis, May 16, 2016.

  1. Jarvis

    Jarvis Member

    I'm running a POST curl after a user submits a form, however the response I get from the request gives me a java error that displays on the page as:

    The following error occurred
    The server responded with an error. The error message is in the JavaScript console.

    How can I have the xenforo JS just ignore the response and now throw me an error?

    For reference, here is my PHP code:

            $ch  curl_init();
    curl_setopt($chCURLOPT_URL$url );
    curl_setopt($chCURLOPT_USERAGENT,'My App');
    $response curl_exec($ch);
  2. Jarvis

    Jarvis Member

    I found out this is due to the xenforo debugging javascript.

    On live, this works fine.
  3. Jarvis

    Jarvis Member


    It's throwing the error again. The only 'error' is the API response.

Share This Page