Get rid of could not in the beginning of the wrapped error messages #1535

Open
opened 2024-12-04 08:20:54 +00:00 by fyrchik · 1 comment
Owner

It makes each error unreadable, while adding nothing to the context.
Same for failed to, same for can't.
Basically, what we did: %w.
https://github.com/uber-go/guide/blob/master/style.md#error-wrapping has more elaborate rationale.

The only way for error to be handled is logging and there we use either field name or level, so this context won't be lost.

It makes each error unreadable, while adding nothing to the context. Same for `failed to`, same for `can't`. Basically, `what we did: %w`. https://github.com/uber-go/guide/blob/master/style.md#error-wrapping has more elaborate rationale. The only way for error to be handled is logging and there we use either field name or level, so this context won't be lost.
fyrchik added the
refactoring
observability
internal
labels 2024-12-04 08:20:54 +00:00
fyrchik self-assigned this 2024-12-04 08:21:05 +00:00
Author
Owner

The last part would be to find or create a linter which catches the most common verbs.

The last part would be to find or create a linter which catches the most common verbs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#1535
No description provided.