-
Notifications
You must be signed in to change notification settings - Fork 57
[Bug] fix issue #439 #440
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
[Bug] fix issue #439 #440
Conversation
in some cases, err.Error() will be called when err is nil, fix it;
pkg/common/utils/mysql/mysql.go
Outdated
if _, ok := m[COMPUTE_GROUP_ID]; !ok { | ||
klog.Errorf("GetBackendsByComputeGroupId backends tag get compute_group_name failed, tag: %s, err: %s\n", be.Tag, err.Error()) | ||
return nil, err | ||
return nil, fmt.Errorf("GetBackendsByComputeGroupId backends tag get compute_group_name failed, tag: %s, err: no compute_group_id field found", be.Tag) |
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.
'klog.Errorf' needs to print the error log, here you need to keep using this method to print this error log
m, err := ResolveConfigMaps(tests, dorisv1.Component_FE) | ||
if err != nil || len(m) == 0 { | ||
t.Errorf("resolve configmaps faild, len=%d, err=%s", len(m), err.Error()) | ||
t.Errorf("resolve configmaps faild, len=%d, err=%#v", len(m), 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.
Try not to use %#v to print structure instances. This may cause err null pointer problems and require post-processing after checking for null.
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.
Please check it
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.
LGTM
in some cases, err.Error() will be called when err is nil, fix it;
What problem does this PR solve?
Issue Number: close #439
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)