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
Fixes #1356: Don't show error message twice #1445
Conversation
Trace after applying this change:
|
080a707
to
1e9fea7
Compare
@technoweenie could you have a look at this? It works, but I'm not entirely sure that it's correct. |
We'd lose valuable error reporting by merging this. @ttaylorr and I have been talking about moving LFS to https://github.com/pkg/errors soon, which should fix how we bubble low level errors up to end users. |
Only show the error message if it's different from the inner message that was already shown. Change-Id: Iff591518853b1c5c229b676d08d8f914f1eb6f62 Signed-off-by: David Pursehouse <dpursehouse@collab.net>
1e9fea7
to
d382f1f
Compare
I've rewritten the commit with a different approach. Now it only shows the second message if it's different to the one already shown. As before, it works for me, but perhaps I'm missing something about why this inner message is needed. How can I reproduce a case where the messages are different? (Note that I'm testing this against Gerrit Code Review with a work-in-progress implementation of LFS).
Is "soon" soon enough that we can just give up trying to make an interim fix for this? |
@dpursehouse Ah, this looks better. We plan to either ship v1.4.0 this week (with |
Error(innermsg) | ||
} | ||
var msg string = err.Error() | ||
if msg != innermsg { |
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.
Let's inline this to be:
if msg := err.Error(); msg != innermsg {
Error(msg)
}
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.
Do you still want me to make this change in this PR, or will you instead use the version in #1453 ?
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.
I think now that 1453 exists we can leave this as-is 😄
Looks great 👍 |
I'm thinking we should merge this now. If we need v1.3.2, we can backport easily to the Also, this code is very similar to I added another commit to this PR in #1453. |
Change-Id: Iff591518853b1c5c229b676d08d8f914f1eb6f62
Signed-off-by: David Pursehouse dpursehouse@collab.net