Add tests for hook error handling