servicer-labs / servicer

A CLI to simplify service management on systemd
https://servicer.dev
MIT License
419 stars 8 forks source link

Use ? operator replace unwrap to handle error #2

Closed chikaku closed 1 year ago

chikaku commented 1 year ago

before:

$ ./target/release/servicer create index.js
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "index.js is not a file"', src/main.rs:172:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

after:

$ ./target/release/servicer create index.js
Error: "index.js is not a file"
secretshardul commented 1 year ago

Agree that the errors are untidy but line numbers help with debugging (#1). Let's attain more stability then we can merge this PR.

secretshardul commented 1 year ago

Merged in v0.1.4