1
0
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:
Rob Ede
2023-09-10 02:56:48 +01:00
parent e67443f4e8
commit c5a9579193
6 changed files with 22 additions and 18 deletions

View File

@ -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