Is it better to use require, assert and check func...
# announcements
c
Is it better to use require, assert and check functions or to just throw exceptions/errors myself?
s
use require and check, they’re (imo) much more concise
assert is a weird one if you’re not familiar with assertions on the jvm
c
Should I pass some throwables to them, so it's clear what happened or is the message string enough?
s
if you have throwables, then you should include them, but if you can’t handle that case, maybe it’d be worth it to just let the exception bubble up
specifically if you’re, for example, calling
error
to “handle” an exception
at that point you just ought to rethrow (or just not catch the exception in the first place)
💯 1