Skip to content

Instantly share code, notes, and snippets.

@traviskroberts
Created May 1, 2014 17:49
Show Gist options
  • Save traviskroberts/68f08a1a61b5b8b6af08 to your computer and use it in GitHub Desktop.
Save traviskroberts/68f08a1a61b5b8b6af08 to your computer and use it in GitHub Desktop.
Code to handle global ajax error codes.
# handle api errors
$.ajaxSetup
statusCode:
401: ->
# authentication error
404: ->
# not found
500: ->
# application error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment