is it possible to throw custom exceptions using `r...
# announcements
l
is it possible to throw custom exceptions using
require
and
requireNotNull
? currently afaik it always throws an
IllegalArgumentException
s
apart from writing your own mehtods, nope.
z
require(NotNull)
throws
IllegalArgumentException
,
check(NotNull)
throws
IllegalStateException
, if you want something else just write an if statement and throw an exception, it’s barely even boilerplate.
☝️ 2