aatxe / irc

the irc crate – usable, async IRC for Rust
Mozilla Public License 2.0
527 stars 100 forks source link

Too generic error: "No such file or directory" when loading the config file...and a certificate file. #212

Closed Folaht closed 3 years ago

Folaht commented 4 years ago

$cargo run

Finished dev [unoptimized + debuginfo] target(s) in 0.13s
Running /home/folaht/testbot/devlohpmaq/target/debug/testbot
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })', src/main.rs:10:15
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

$strace target/debug/testbot

openat(AT_FDCWD, "cert.der", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Aucun fichier ou dossier de ce type)

main.rs

...
let cfg = Config::load("/home/folaht/.config/testbot/config.toml").unwrap();
...
$cat /home/folaht/.config/testbot/config.toml
nickname = "Testbottest1234"
server = "irc.freenode.net"
...
cert = cert.der
...

I'm a complete beginner in rust, so for two days I thought the error meant that it couldn't find the config.toml file. It turns out it was the certification file that it couldn't find.