test error handling