I think it would be better if this raised an exception that the caller can catch.