You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the recommended way of creating custom exceptions is the create_exception! macro. Unfortunately, it does not allow a docstring to be specified (since that docstring will be attached to the macro invocation and not to the actual class it creates), which leads to several problems:
Rust compiler gives a missing docstring warning, which cannot be silenced by #[allow(missing_docs)] (for the same reason an actual docstring cannot be specified)
One cannot define a docstring for the created exception and have it picked up by introspecting tools on the Python side (like help() in REPL, or sphinx.autodoc)
I tried doing an analogue of class MyError(Exception): pass in Rust (that's really all I need), but couldn't figure out how to write a constructor.