faradayio / boondock

Docker daemon API in Rust
43 stars 14 forks source link

Docker connection mechanism error handling fail. #27

Open lowlevl opened 6 years ago

lowlevl commented 6 years ago

So I've been using the lib like so :

user@computer: ~$ cat src/main.rs 
extern crate boondock;
use boondock::Docker;

fn main() {
    let docker = Docker::connect_with_defaults().unwrap();
}
user@computer: ~$ # No docker on my computer, the program should panic because of the .unwrap().
user@computer: ~$ which docker
user@computer: ~$ # Nor the default socket
user@computer: ~$ ls /var/run/docker.sock
ls: cannot access '/var/run/docker.sock': No such file or directory
user@computer: ~$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.20s
     Running `target/debug/opendd`
user@computer: ~$ # Unfortunately, no crash .-.
user@computer: ~$

Maybe I don't understand, but it's pretty straight forward to me that this should crash because connect_with_defaults() returns a Result<Docker>.