utils

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSSLErrorHint

func GetSSLErrorHint(err error) *string

GetSSLErrorHint returns a hint string if the error is an SSL error, suggesting corporate proxy or NODE_EXTRA_CA_CERTS configuration.

func SanitizeAPIError

func SanitizeAPIError(message string) string

SanitizeAPIError extracts the <title> content from HTML error responses, or returns the message as-is if it is not HTML.

Types

type ConnectionErrorDetails

type ConnectionErrorDetails struct {
	Code       string
	Message    string
	IsSSLError bool
}

ConnectionErrorDetails holds details about a connection error.

func ExtractConnectionErrorDetails

func ExtractConnectionErrorDetails(err error) *ConnectionErrorDetails

ExtractConnectionErrorDetails walks the error chain up to 5 levels deep, looking for an error with a Code() string method, and checks if the code is a known SSL error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL