Skip to content

AJAX errors explained

I’ve recently finished adding Google Analytics to a mobile App I’ve been working on for some time, and it’s been returning quite a few different error codes from the API.  So, I’m keeping track of them here along with their causes – to make debugging faster and easier in the future.

Status: 406 / Error: Not Acceptable / Error Thrown: Not Acceptable

  1. A server side issue with the response
  2. The session on the server timed out

Status: 0 / Error: error

  1. user was unable to reach the server (most likely connection issue)

Status: 200 / Error: OK / Error Thrown: SyntaxError: Unexpected end of input

  1. Returned JSON was cut off (possibly connection issue)
  2. No JSON whatsoever was returned

Status: 0 / Error: timeout / Error Thrown: timeout

  1. duh, timeout!

Status: 200 / Error: OK / Error Thrown: SyntaxError: Unexpected token

  1. Have HTML returning instead of JSON
  2. Malformed JSON

Status: 401 / Error: Unauthorized / Error Thrown: Unauthorized

  1. User tried to login with wrong username and password
Published inTime Wasters

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *