I'm stuck with a simple exception that I can't catch:
//myScript.js.coffee
try
$.ajax
async: false
type: "GET"
url: index_url
success: ->
//Do something
error: ->
//Do something else
fail: ->
//Do something else
catch e
console.log e
When I try to call this Ajax with a bad url, there is an error and nothing caught it. Does any one have an idea ?
Basically I would like to test the url before calling this ajax request.
Edit:
I know that putting a try/catch with an asynchronous function
is useless but it's to show that I tried different ways to catch those exceptions
but nothing works.