nginx/ngx-rust

Rust-style error handling

Opened this issue · 0 comments

Yet another awkward pattern we repeat a lot

let x = call_fn();
if x.is_bad() {
    return core::Status::NGX_ERROR.into();
}

instead of more canonical let x = call_fn()?;.

We should convert as much of these cases as possible to a proper use of Result and std::error::Error implementations.
Some macro magic might be necessary to wrap existing nginx-sys APIs.