func (w WaitQueueTimeoutError) Unwrap() error {
	return w.Wrapped
}
Unwrap returns the underlying error.
package topology
import (
	"fmt"
	"go.mongodb.org/mongo-driver/mongo/description"
)
type ConnectionError struct {
	ConnectionID string
	Wrapped      error
	init    bool
	message string
}
func (e ConnectionError) Error() string {
	message := e.message
	if e.init {
		fullMsg := "error occured during connection handshake"
		if message != "" {
			fullMsg = fmt.Sprintf("%s: %s", fullMsg, message)
		}
		message = fullMsg
	}
	if e.Wrapped != nil && message != "" {
		return fmt.Sprintf("connection(%s) %s: %s", e.ConnectionID, message, e.Wrapped.Error())
	}
	if e.Wrapped != nil {
		return fmt.Sprintf("connection(%s) %s", e.ConnectionID, e.Wrapped.Error())
	}
	return fmt.Sprintf("connection(%s) %s", e.ConnectionID, message)
}
func (e ConnectionError) Unwrap() error {
	return e.Wrapped
}
type ServerSelectionError struct {
	Desc    description.Topology
	Wrapped error
}
func (e ServerSelectionError) Error() string {
	if e.Wrapped != nil {
		return fmt.Sprintf("server selection error: %s, current topology: { %s }", e.Wrapped.Error(), e.Desc.String())
	}
	return fmt.Sprintf("server selection error: current topology: { %s }", e.Desc.String())
}
func (e ServerSelectionError) Unwrap() error {
	return e.Wrapped
}
type WaitQueueTimeoutError struct {
	Wrapped error
}
func (w WaitQueueTimeoutError) Error() string {
	errorMsg := "timed out while checking out a connection from connection pool"
	if w.Wrapped != nil {
		return fmt.Sprintf("%s: %s", errorMsg, w.Wrapped.Error())
	}
	return errorMsg
}