You can just use the fail callback and examine the status code returned by the request. E.g.
- app.SecureModel
- .findAll()
- .done( function( list ) { /* do whatever with your list of models when request has succeeded */ })
- .fail( function( xhr ) {
- if ( xhr.status === 401 ) { /* pop a window that will allow the user to login again before retrying the request */ }
- else { /* pop a general error window, if you care about that kind of error reporting to the user */ }
- })