error handling + test case