node: Fix non-informative message when parse node attributes #475

Merged
fyrchik merged 1 commit from acid-ant/frostfs-node:bugfix/455-fix-logs into master 2023-06-28 15:02:31 +00:00
Member

Close #455

Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com

Close #455 Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
acid-ant requested review from storage-core-committers 2023-06-27 11:33:59 +00:00
acid-ant requested review from storage-core-developers 2023-06-27 11:33:59 +00:00
dstepanov-yadro approved these changes 2023-06-28 06:26:48 +00:00
fyrchik reviewed 2023-06-28 07:31:06 +00:00
@ -37,3 +36,3 @@
if k == "" {
return errors.New("empty key")
return fmt.Errorf("unable to parse key of the node attribute from string '%s'", attrs[i])
Owner

To me empty key and empty value are OK, they just need a little more context (that these are key/value from a section node.attributes

To me `empty key` and `empty value` are OK, they just need a little more context (that these are key/value from a section `node.attributes`
Author
Member

Updated.

Updated.
fyrchik marked this conversation as resolved
fyrchik reviewed 2023-06-28 07:31:38 +00:00
@ -22,3 +21,3 @@
k, v, found := strings.Cut(line, keyValueSeparator)
if !found {
return errors.New("missing attribute key and/or value")
return fmt.Errorf("wrong format for attribute: '%s'", attrs[i])
Owner

s/attribute/node attribute/ ? To be consistent with the errors below.

s/attribute/node attribute/ ? To be consistent with the errors below.
Author
Member

Fixed.

Fixed.
fyrchik marked this conversation as resolved
acid-ant force-pushed bugfix/455-fix-logs from 0a51f2c21f to 1fa7ebc457 2023-06-28 07:45:30 +00:00 Compare
fyrchik approved these changes 2023-06-28 15:02:21 +00:00
fyrchik merged commit d01c064674 into master 2023-06-28 15:02:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#475
No description provided.