Conversation
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
| func (e ErrorResult) Error() string { | ||
| sb := strings.Builder{} | ||
| if len(e.ErrorMessages) > 0 { | ||
| sb.WriteString(fmt.Sprintf("error messages: %s ", e.ErrorMessages)) |
There was a problem hiding this comment.
Nit: Should we maybe string.Join(e.ErrorMessages, ";") or something like this here?
There was a problem hiding this comment.
I always find those hard to read when multiple error happen, I'd prefer JSON-style array for those, which is done natively by Sprintf %s.
There was a problem hiding this comment.
I'm not sure about the error messages format (do they include some punctuation?), but adding a join char should help with readability.
Otherwise we might end up with a long string without knowing where a particular ErrorMessage starts and where it ends
Eg
V=[issue invalid format error]
using join=issue invalid; format error
Co-authored-by: Roman Tkachenko <roman@goteleport.com>
| return trace.Errorf("http error code=%v, errors=[%s]", resp.StatusCode(), result) | ||
| case nil: | ||
| return nil | ||
| default: |
There was a problem hiding this comment.
If the error is >399 (resp.IsError()==true), does it make sense to return nil if no error is defined?
There was a problem hiding this comment.
I think this should be unreachable, but I'm quite afraid of breaking something 😓 . It feels like this was added on purpose. Maybe for the "request cancelled" kind of issues.
| func (e ErrorResult) Error() string { | ||
| sb := strings.Builder{} | ||
| if len(e.ErrorMessages) > 0 { | ||
| sb.WriteString(fmt.Sprintf("error messages: %s ", e.ErrorMessages)) |
There was a problem hiding this comment.
I'm not sure about the error messages format (do they include some punctuation?), but adding a join char should help with readability.
Otherwise we might end up with a long string without knowing where a particular ErrorMessage starts and where it ends
Eg
V=[issue invalid format error]
using join=issue invalid; format error
|
@hugoShaka See the table below for backport results.
|
Fixes #38231
Changelog: Make the Jira access plugin log Jira errors properly.