|
|
|
|
|
by fuzzy2
166 days ago
|
|
Doing it like this (or preferably with a custom exception) translates the technical problem into a domain problem. Without doing this, callers can't properly handle it. FormatException or OverflowException could be thrown at multiple locations, not just in parsing the user ID. This here is an InvalidUserIdException. It could be derived from ArgumentException, but IMHO InvalidOperationException is not appropriate. |
|
I would rather see custom exceptions thrown than rethrowing.