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

Better error than "thread 'main' panicked at 'assertion failed: command.is_absolute()', src/formatter.rs:165:9" #179

Open
justinwoo opened this issue Sep 20, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@justinwoo
Copy link

Is your feature request related to a problem? Please describe.

treefmt 0.4.1

I am getting thread 'main' panicked at 'assertion failed: command.is_absolute()', src/formatter.rs:165:9 when treefmt cannot resolve a formatter's filepath (or something).

Describe the solution you'd like

I would like to get a written error message with

  • What was attempted
  • What was expected
  • What is a possible resolution

Describe alternatives you've considered

Keeping this message the same and requiring everyone to look at the source code to have some clues as to what is going on

Additional context

I assume treefmt is meant to be used by people rather than some scripts

@justinwoo justinwoo added the enhancement New feature or request label Sep 20, 2022
@zimbatm
Copy link
Member

zimbatm commented Sep 20, 2022

Can you share your treefmt.toml and on which OS you're running? If it's reaching the assertions, it's hitting a bug somewhere that I need to reproduce.

@zimbatm
Copy link
Member

zimbatm commented Sep 20, 2022

And also the output of treefmt -vvv, or at least the last line that shows "Found {} at {}"

@justinwoo
Copy link
Author

i'm using mac os 12.6 with an M2 with command = "prettier"

@zimbatm
Copy link
Member

zimbatm commented Sep 20, 2022

Can you give me the output of treefmt -vvv 2>&1 | grep " Found " ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants