Exceptions are the only way. You can workaround this by using static factory methods.
The herbceptions proposal for “deterministic” exceptions addressed this issue well IMO.
The herbceptions proposal for “deterministic” exceptions addressed this issue well IMO.