tinyspline
tinyspline copied to clipboard
Different exceptions for different kinds of errors
TS_MALLOC => https://en.cppreference.com/w/cpp/memory/new/bad_alloc TS_INDEX_ERROR => https://en.cppreference.com/w/cpp/error/out_of_range TS_U_UNDEFINED => https://en.cppreference.com/w/cpp/error/domain_error TS_IO_ERROR => custom (e.g. io_error) Remaining => https://en.cppreference.com/w/cpp/error/invalid_argument
Errors can be mapped to C++ exceptions using a single macro. Swig provides the following exceptions:
bad_alloc => SWIG_MemoryError out_of_range => SWIG_IndexError domain_error => SWIG_ValueError custom (io_error) => SWIG_IOError invalid_argument => SWIG_ValueError