The documentation indicates that the error: option function will make available: XHR instance, a status message string (in this case always error) and an optional exception
This is an aside, but I think there's a bug in the code you submitted. The line:
if (error = "timeout") {
should have more equals signs in it:
if (error == "timeout") {