-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherroralert.js
More file actions
26 lines (24 loc) · 777 Bytes
/
erroralert.js
File metadata and controls
26 lines (24 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* Displays error alert
* @param jqXHR
* @param exception
* @param errorThrown
*/
function errorAlert(jqXHR,exception,errorThrown){
if (jqXHR.status === 0) {
alert('Not connect.\n Verify Network.');
} else if (jqXHR.status == 404) {
alert('Requested page not found. [404]');
} else if (jqXHR.status == 500) {
alert('Internal Server Error [500].');
} else if (exception === 'parsererror') {
alert('Requested JSON parse failed.' + errorThrown);
} else if (exception === 'timeout') {
alert('Time out error.');
} else if (exception === 'abort') {
alert('Ajax request aborted.');
} else {
alert('Uncaught Error.\n' + jqXHR.responseText);
}
}
// Moved to src/erroralert.js