JuliaAstro / AstroLib.jl

Bundle of small astronomical and astrophysical routines.
http://juliaastro.github.io/AstroLib.jl/stable/
Other
78 stars 21 forks source link

Use more specific error types #85

Closed abhro closed 4 months ago

abhro commented 4 months ago

@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).

giordano commented 4 months ago

Thanks!