JuliaRheology / RHEOS.jl

RHEOS - Open Source Rheology data analysis software
MIT License
39 stars 9 forks source link

Error messages using @assert need to be turned into normal exceptions #105

Closed akabla closed 3 years ago

akabla commented 3 years ago

We deal with many errors in parameters with an @assert macro. For instance: @assert hastime(d) "Data without time information cannot be resampled."

@assert may be disabled with certain optimisations, and therefore not appropriate for this usage. https://docs.julialang.org/en/v1/base/base/#Base.@assert

It would be more appropriate to reserve @assert for debugging purposes only, and use proper exceptions for error message supposed to be helpful to the user.

This page may be useful: https://scls.gitbooks.io/ljthw/content/_chapters/11-ex8.html

moustachio-belvedere commented 3 years ago

Important issue, but I think this is duplicated:

https://github.com/JuliaRheology/RHEOS.jl/issues/81

akabla commented 3 years ago

indeed! let me close this here - no need to have it twice.