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

Flag to shorten error output #837

Open
Lootwig opened this issue Sep 27, 2023 · 4 comments
Open

Flag to shorten error output #837

Lootwig opened this issue Sep 27, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Lootwig
Copy link
Contributor

Lootwig commented Sep 27, 2023

When working on a laptop, my console is usually just 4-6 lines high.

The error output Could not find the correct Provider<X> above this Y Widget is followed by a long chunk of instructions on how to use provider before the stack trace is shown - however, usually these two are the only things I care about as someone who is familiar with the package: what provider I forgot to create, and where it's missing.

I'm happy to contribute on this, I was thinking a global bool Provider.conciseErrors setter would do the trick - any objections?

@rrousselGit
Copy link
Owner

I'm not fond of the idea.
I don't want to have random configuration flags for such a thing.

But we can improve the message if you have any idea on what could be made better

@Lootwig
Copy link
Contributor Author

Lootwig commented Sep 27, 2023

How about an FAQ (or "Frequently Done Wrong") one-liner URL instead? For reference, the current instructions are 45 lines long

@Lootwig
Copy link
Contributor Author

Lootwig commented Sep 27, 2023

Alternatively, swap the order of the instructions and the info which provider was missing, so that an auto-scrolling console will have the most relevant info at the bottom:

- [provider how-to...]
- Error: Could not find the correct Provider<$valueType> above this $widgetType Widget
- [Stacktrace]

@rrousselGit
Copy link
Owner

Maybe we could show the type both at the start and the end.
Having it at the start is important I think.

In any case, I don't care too much about this. Fancy making a PR?

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