Add hooks for handling error

#### Feature:
This will add a hook for handling dispatch errors.

#### Ticket:
https://app.asana.com/0/5618297459705/5683934718834

Notes:
  * Please review and merge if good. Thanks!