diff --git a/internal/proxy/engine.go b/internal/proxy/engine.go index c7dbc72..94d0fca 100644 --- a/internal/proxy/engine.go +++ b/internal/proxy/engine.go @@ -5,6 +5,7 @@ import ( "crypto/sha256" "encoding/hex" "encoding/json" + "errors" "fmt" "io" "log/slog" @@ -422,8 +423,6 @@ func (e *UpstreamError) Error() string { return fmt.Sprintf("upstream error: %v" func (e *UpstreamError) Unwrap() error { return e.Err } func isNetworkError(err error) bool { - if _, ok := err.(*UpstreamError); ok { - return true - } - return false + var ue *UpstreamError + return errors.As(err, &ue) }