Created
December 18, 2014 17:50
-
-
Save GeoffCox/b3778ace858f93e063e2 to your computer and use it in GitHub Desktop.
Extract ajax error message from MVC exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private _getErrorMessage(jqXHR: JQueryXHR, textStatus, errorThrown): string { | |
var message = textStatus + ' ' + errorThrown; | |
var error = <any>$.parseJSON(jqXHR.responseText); | |
if (error) { | |
message = error.Message; | |
if (error.ExceptionMessage) { | |
message += error.ExceptionMessage; | |
} | |
} | |
return message; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment