Pass entire error object instead of just message