Use error object when passing an error to callback