-
Notifications
You must be signed in to change notification settings - Fork 685
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
fix: show field name in error message when base64 decoding fails #1519
Conversation
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.
Thanks for the PR. I've left some comments.
} | ||
|
||
if !strings.Contains(err.Error(), "foo") { | ||
t.Errorf("Unseal error did not contain field name %q: %v", "foo", err) |
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.
For consistency with the other tests:
t.Errorf("Unseal error did not contain field name %q: %v", "foo", err) | |
t.Errorf("Expecting error: %v to contain field %q", err, "foo") |
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.
changed
|
||
_, err := sealedSecret.Unseal(codecs, keys) | ||
if err == nil { | ||
t.Fatalf("Unseal did not return expected error: %v", err) |
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.
For consistency with the other tests:
t.Fatalf("Unseal did not return expected error: %v", err) | |
t.Fatalf("Expecting error: got nil instead") |
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.
changed
Signed-off-by: Maximilian Gaß <m.gass@babiel.com>
6227b53
to
f742928
Compare
Description of the change
unsealing errors usually show the field name that caused the error - except for base64 decoding. This change fixes that.
Benefits
clearer error message
Possible drawbacks
none
Applicable issues
Additional information