I figured out how to do this, and it works great:
$.get( URL ) .then( function (data, status, res) { if(({ return $.Deferred().reject(res, status, "error message"); } return $.Deferred().resolve(data, status, res); } ) .done( function (data, status, res) {
works like a charm, now I donβt have the dirty data error handling in my done, I can just focus on processing the data or setting up error messages.
Chris DaMour
source share