consistent error handling