Refactor error handling logic and string formatting

Replaced constant with named error for readability and maintainability in the error handling condition. Adjusted error message formatting by removing an extra space for consistency.
This commit is contained in:
Winni Neessen 2024-11-01 15:57:59 +01:00
parent 27a3985240
commit 25b7f81e3b
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -81,7 +81,7 @@ type SendErrReason int
// Returns:
// - A string representing the error message.
func (e *SendError) Error() string {
if e.Reason > 10 {
if e.Reason > ErrAmbiguous {
return "unknown reason"
}