What does `UUID!` mean?
# getting-started
z
What does
UUID!
mean?
d
z
if I pass a wrong UUID, it will throw
IllegalArgumentException
right? And how to handle it?
d
you need try..catch.. block for this..
j
Yes, but that has nothing to do with the exclamation point at the end of UUID. You handle it like any other exception: either you can handle the exception (which means you can still return a correct UserMapper from your method even though the id is not a valid UUID), and in that case, you catch the exception to handle it. Or you can’t do anything about it, which means that the caller (or the caller of the caller, etc.) needs to handle this situation somehow, and in that case you simply let the exception be thrown, or catch it and throw another type of exception, more suited to your level of abstraction.