pass xhr within error object