dana-medical-site/internal/api/redact.go
2026-10-14 13:33:13 +00:00

18 lines
441 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package api
import (
"errors"
"fmt"
"net/url"
)
// redactURL убирает адрес запроса из сетевой ошибки. У SMSC логин и пароль передаются
// в адресе, поэтому ошибку с адресом нельзя писать в лог.
func redactURL(err error) error {
var ue *url.Error
if errors.As(err, &ue) {
return fmt.Errorf("%s: %w", ue.Op, ue.Err)
}
return err
}