better error handling tests