diff options
-rw-r--r-- | src/ajax.js | 4 | ||||
-rw-r--r-- | test/unit/ajax.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/ajax.js b/src/ajax.js index bf81d3a73..fb5f08c1d 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -752,10 +752,10 @@ jQuery.extend({ } catch (e) { // Propagate exception as error if not done if ( state < 2 ) { - done( -1, e.message ); + done( -1, e ); // Simply rethrow otherwise } else { - jQuery.error( e.message ); + throw e; } } } diff --git a/test/unit/ajax.js b/test/unit/ajax.js index c89224c2e..9527beea1 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1616,7 +1616,7 @@ test("jQuery.ajax() - malformed JSON", function() { }, error: function(xhr, msg, detailedMsg) { equal( "parsererror", msg, "A parse error occurred." ); - ok( /^(Invalid|SyntaxError|exception)/i.test(detailedMsg), "Detailed parsererror message provided" ); + ok( /(invalid|error|exception)/i.test(detailedMsg), "Detailed parsererror message provided" ); start(); } }); |