This is legacy code, and I don't think it should be used anywhere going forward.  This particular ajax request just expects errors to be indicated by headers.  We'd have to do a bit of refactoring to change this.