improve error handling by using error-stack crate

This commit is contained in:
xffxff 2023-06-14 20:42:30 +08:00
parent e8935bc52d
commit 9a4cf949e4
5 changed files with 133 additions and 90 deletions

17
Cargo.lock generated
View file

@ -268,6 +268,12 @@ dependencies = [
"alloc-no-stdlib",
]
[[package]]
name = "anyhow"
version = "1.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
[[package]]
name = "askama_escape"
version = "0.10.3"
@ -733,6 +739,16 @@ dependencies = [
"libc",
]
[[package]]
name = "error-stack"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f00447f331c7f726db5b8532ebc9163519eed03c6d7c8b73c90b3ff5646ac85"
dependencies = [
"anyhow",
"rustc_version 0.4.0",
]
[[package]]
name = "failure"
version = "0.1.8"
@ -3373,6 +3389,7 @@ dependencies = [
"actix-files",
"actix-web",
"env_logger",
"error-stack",
"fake-useragent",
"handlebars",
"log",