Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when search_dirs.path doesn't exist #100

Open
ohlus opened this issue May 9, 2024 · 0 comments · May be fixed by #101
Open

Panic when search_dirs.path doesn't exist #100

ohlus opened this issue May 9, 2024 · 0 comments · May be fixed by #101

Comments

@ohlus
Copy link

ohlus commented May 9, 2024

After updating, I started getting panics on some of my machines every time I tried to run tms.

The cause is that some directories in my config were missing on the filesystem. Env vars expansion introduced in #73 unwraps the results of shellexpand and canonicalize. And canonicalize fails when the path doesn't exist.

$ RUST_BACKTRACE=1 tms
thread 'main' panicked at src/configs.rs:142:26:
called `Result::unwrap()` on an `Err` value: IO Error
│
╰─▶ No such file or directory (os error 2)
    ╰╴backtrace (1)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

backtrace no. 1
   0: error_stack::report::Report<C>::from_frame
   1: <core::result::Result<T,C> as error_stack::result::ResultExt>::change_context
   2: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
   3: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
   4: tms::configs::Config::search_dirs
   5: tms::main
   6: std::sys_common::backtrace::__rust_begin_short_backtrace
   7: std::rt::lang_start::{{closure}}
   8: std::panicking::try
   9: std::rt::lang_start_internal
  10: main
  11: __libc_start_call_main
  12: __libc_start_main@@GLIBC_2.34
  13: _start
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
   4: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
   5: tms::configs::Config::search_dirs
   6: tms::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@ohlus ohlus linked a pull request May 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant