Error handling hooks

master pull request for https://github.com/payrollhero/dispatch-rider/pull/18