Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different exceptions for different kinds of errors #157

Open
msteinbeck opened this issue Apr 20, 2020 · 0 comments
Open

Different exceptions for different kinds of errors #157

msteinbeck opened this issue Apr 20, 2020 · 0 comments

Comments

@msteinbeck
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant