add test case and error message

add test case and error message