actix / actix/actix-web

Provide mutable reference APIs for errors

Open
#4,061 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
24.8k
Forks
1.9k
Avg merge
23h 10m
Merged PRs (30d)
26

Description

Somewhat related to https://github.com/actix/actix-web/issues/3758

`&mut` equivalents of `actix_web::Error::as_response/as_error` and similarly `HttpResponse::error` could be provided.

An example use case for them: when an `actix_web::Error` wraps a custom Error type that provides an unresolved `backtrace::Backtrace` (via [Backtrace::new_unresolved](https://docs.rs/backtrace/0.3.76/backtrace/struct.Backtrace.html#method.new_unresolved)). Allowing mutability of its inner Error enables the ability to resolve such a `Backtrace` as lazily as possible/only when needed, e.g. in a middleware that emits certain Error's stacktraces to a service like Sentry.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.