create tests for handling errors