4 ms·
Exceptions are meant to represent exceptional states. The data is always expected to be valid and there is no recovery? .Parse The data may be invalid and the
by neonsunset 2y ago
Exceptions are meant to represent exceptional states.
The data is always expected to be valid and there is no recovery? .Parse
The data may be invalid and the implementation can handle it? .TryParse
This is a very common pattern and adopted for reasons besides the cost of exceptions. Though in this case it is Uri.TryCreate instead.