dial.go raw

   1  package errors
   2  
   3  import (
   4  	"errors"
   5  	"fmt"
   6  )
   7  
   8  // ErrConnContextClosed is returned when a client connection operation is attempted on a closed connection context.
   9  var ErrConnContextClosed = errors.New("client connection context closed")
  10  
  11  // DialError represents an error encountered while attempting to dial a specific endpoint.
  12  // It includes both the address of the endpoint and the error that occurred.
  13  type DialError struct {
  14  	Err  error
  15  	Addr string
  16  }
  17  
  18  // Error returns the error message formatted with the endpoint address and the underlying error details.
  19  func (d *DialError) Error() string {
  20  	return fmt.Sprintf("error dialing to endpoint '%s': %s", d.Addr, d.Err.Error())
  21  }
  22