Skip to content

Commit

Permalink
added hints to common beginner error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
9FS committed Sep 13, 2024
1 parent f707819 commit 0056907
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
name = "nhentai_archivist"
readme = "readme.md"
repository = "https://github.com/9-FS/nhentai_archivist"
version = "3.1.1"
version = "3.1.2"

[dependencies]
chrono = { version = "^0.4.0", features = ["serde"] }
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3"
services:
nhentai_archivist:
container_name: "nhentai_archivist"
image: "ghcr.io/9-fs/nhentai_archivist:3.1.1"
image: "ghcr.io/9-fs/nhentai_archivist:3.1.2"
environment:
HOST_OS: "Unraid"
PGID: 100
Expand Down
14 changes: 5 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,16 @@ fn main() -> std::process::ExitCode
log::error!("{e}"); // log error
match e
{
Error::Reqwest(e) => log::error!("{e}"),
Error::ReqwestClientBuilder { source } => log::error!("{source}"),
#[allow(unused_variables)]
Error::ReqwestStatus {url, status} =>
{
if status == reqwest::StatusCode::FORBIDDEN
if status == reqwest::StatusCode::FORBIDDEN // if status is forbidden
{
log::error!("Test connecting to \"{url}\" failed with status code {status}. Check if cookies \"cf_clearance\", \"csrftoken\", and user agent are set and current.");
}
else
{
log::error!("Test connecting to \"{url}\" failed with status code {status}.");
log::error!("Are \"CF_CLEARANCE\", \"CSRFTOKEN\", and \"USER_AGENT\" set and current?"); // add hint
}
}
Error::Sqlx(e) => log::error!("{e}"),
Error::Sqlx(_) => log::error!("Have you created the database directory? By default, that's \"./db/\"."), // add hint
_ => {},
}
return std::process::ExitCode::FAILURE;
}
Expand Down

0 comments on commit 0056907

Please sign in to comment.