test error case as well