mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
update testing docs to give less precedence to unit testing
This commit is contained in:
@ -8,7 +8,7 @@ import CodeBlock from "@site/src/components/code_block.js";
|
||||
|
||||
Actix Web uses its own [`actix_web::error::Error`][actixerror] type and [`actix_web::error::ResponseError`][responseerror] trait for error handling from web handlers.
|
||||
|
||||
If a handler returns an `Error` (referring to the [general Rust trait `std::error::Error`][stderror]) in a `Result` that also implements the `ResponseError` trait, actix-web will render that error as an HTTP response with its corresponding [`actix_web::http::StatusCode`][status_code]. An internal server error is generated by default:
|
||||
If a handler returns an `Error` (referring to the [general Rust trait `std::error::Error`][stderror]) in a `Result` that also implements the `ResponseError` trait, Actix Web will render that error as an HTTP response with its corresponding [`actix_web::http::StatusCode`][status_code]. An internal server error is generated by default:
|
||||
|
||||
```rust
|
||||
pub trait ResponseError {
|
||||
@ -36,7 +36,7 @@ fn index(_req: HttpRequest) -> io::Result<NamedFile> {
|
||||
}
|
||||
```
|
||||
|
||||
See [the actix-web API documentation][responseerrorimpls] for a full list of foreign implementations for `ResponseError`.
|
||||
See [the Actix Web API documentation][responseerrorimpls] for a full list of foreign implementations for `ResponseError`.
|
||||
|
||||
## An example of a custom error response
|
||||
|
||||
|
Reference in New Issue
Block a user