File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 11//! # `@throw` and `@try/@catch` exceptions.
22//!
3- //! By default, if the [`msg_send!`] macro causes an exception to be thrown,
4- //! this will unwind into Rust, resulting in undefined behavior. However, this
5- //! crate has an `"catch-all"` feature which, when enabled, wraps each
6- //! [`msg_send!`] in a `@catch` and panics if an exception is caught,
7- //! preventing Objective-C from unwinding into Rust.
3+ //! By default, if a message send (such as those generated with the
4+ //! [`msg_send!`] and [`extern_methods!`] macros) causes an exception to be
5+ //! thrown, `objc2` will simply let it unwind into Rust.
6+ //!
7+ //! While not UB, it will likely end up aborting the process, since Rust
8+ //! cannot catch foreign exceptions like Objective-C's. However, `objc2` has
9+ //! the `"catch-all"` Cargo feature, which, when enabled, wraps each message
10+ //! send in a `@catch` and instead panics if an exception is caught, which
11+ //! might lead to slightly better error messages.
812//!
913//! Most of the functionality in this module is only available when the
1014//! `"exception"` feature is enabled.
You can’t perform that action at this time.
0 commit comments