-
Notifications
You must be signed in to change notification settings - Fork 42
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
print a nicer error on timeout/cancel #137
Conversation
*Don't* say "context canceled". Just say "canceled". fixes ipfs/kubo#3785
case context.DeadlineExceeded: | ||
msg = "timed out" | ||
default: | ||
msg = err.Error() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need a cmdkit.Error
, we just need the error message.
This now prints:
When a user hits
When the command times out. |
I like this change either way, but wonder if prepending "request" is necessary.
vs
Edit: I feel like the verbose line information etc. was the problem in the original issue rather than an additional word "context". |
That was probably the motivation for the original issue but I've also seen users confused about the term "context". That's a go-ism and, really, an implementation detail. At the end of the day, we just want to communicate:
I'd also like to avoid "request" because that really doesn't have anything to do with what the user is trying to do (they shouldn't even need to consider the fact that |
We can bikeshed this in a followup PR. |
Don't say "context canceled". Just say "canceled".
fixes ipfs/kubo#3785