Properly report AJAX errors

This commit is contained in:
Aaron Lindsay 2017-01-10 06:08:26 -05:00
parent 6e34a72c22
commit bea8be18ff
5 changed files with 16 additions and 16 deletions

View File

@ -80,7 +80,7 @@ function fetchAll() {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -107,7 +107,7 @@ function create(attendee) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -135,7 +135,7 @@ function fetchPopular() {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -159,7 +159,7 @@ function remove(attendee) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };

View File

@ -13,7 +13,7 @@ function serverError(error) {
function ajaxError(error) { function ajaxError(error) {
var e = new Error(); var e = new Error();
e.ErrorId = 5; e.ErrorId = 5;
e.ErrorString = "Request Failed: " + status + error; e.ErrorString = "Request Failed: " + error;
return { return {
type: ErrorConstants.ERROR_AJAX, type: ErrorConstants.ERROR_AJAX,

View File

@ -39,7 +39,7 @@ function fetch(reportId) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };

View File

@ -81,7 +81,7 @@ function fetchAll() {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -108,7 +108,7 @@ function create(suggestion) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -136,7 +136,7 @@ function fetchPopular() {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -160,7 +160,7 @@ function remove(suggestion) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };

View File

@ -96,7 +96,7 @@ function fetch(userId) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -131,7 +131,7 @@ function create(user) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -158,7 +158,7 @@ function login(user) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -184,7 +184,7 @@ function tryResumingSession() {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -208,7 +208,7 @@ function logout() {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };
@ -235,7 +235,7 @@ function update(user) {
} }
}, },
error: function(jqXHR, status, error) { error: function(jqXHR, status, error) {
dispatch(ErrorActions.ajaxError(e)); dispatch(ErrorActions.ajaxError(error));
} }
}); });
}; };