Skip to content

Conversation

vrmiguel
Copy link
Contributor

@vrmiguel vrmiguel commented Dec 8, 2021

It can be common to call kondo on a path that does not exist, which yields quite badly-looking panic message:

$ kondo does-not-exist
thread 'main' panicked at 'Unable to canonicalize!: Os { code: 2, kind: NotFound, message: "No such file or directory" }', kondo-lib/src/lib.rs:320:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This PR still does not quite solve that, since the error message now looks like:

$ kondo does-not-exist
Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

kondo's error treatment is generally still quite lacking but I feel like this PR is a step in the right direction, specially if it could adopt the usage of the fs-err crate in the future

@tbillington
Copy link
Owner

You're right, the error handling in kondo is quite bare. Thank you for the PR :)

@tbillington tbillington merged commit 963e12f into tbillington:master Dec 9, 2021
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 this pull request may close these issues.

2 participants