When submit() fails synchronously, turn it into an asynchronous error

Otherwise users have to duplicate error handling code.