Implement error dispatching.