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

Rust-style error handling #106

Open
bavshin-f5 opened this issue Dec 24, 2024 · 1 comment
Open

Rust-style error handling #106

bavshin-f5 opened this issue Dec 24, 2024 · 1 comment

Comments

@bavshin-f5
Copy link
Member

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.

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

No branches or pull requests

2 participants
@bavshin-f5 and others