macro_rules! bad_api_usage {
    { $( $arg:tt )* } => { ... };
}
Expand description

Create a bad API usage error, including a message like format!, and capturing this call site

The calling stack backtrace is also captured, when the backtrace cargo feature this is enabled.

Examples

use tor_error::bad_api_usage;

let need_target = targets.next().ok_or_else(|| bad_api_usage!("no targets"))?;