@assert can get optimized away by the compiler, and generic error() uses ErrorException, which doesn't provide much information.
Used DomainError for an argument being outside a valid set, and used ArgumentError for multiple arguments relating to each other (e.g., multiple arrays having the same length).
@assert
can get optimized away by the compiler, and genericerror()
usesErrorException
, which doesn't provide much information.Used
DomainError
for an argument being outside a valid set, and usedArgumentError
for multiple arguments relating to each other (e.g., multiple arrays having the same length).