Fail fast on union type
Hi i try to fail fast on union type as i know if there is an error , it's pointless to continue checking the union and get the right message and not the full list of all union message.
For this i throw an error in the union branch and do a try catch on the type generated. Is there a clever/official way to do that:
For this i throw an error in the union branch and do a try catch on the type generated. Is there a clever/official way to do that: