awserr

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package awserr says an AWS error as the Node estimate says it: Node reads err.name and err.message (`${err.name}: ${err.message}` in accounts and discovery, err.message in the reasons of what a nap stops), where the AWS SDK for Go v2's Error() reads "operation error …, https response error …, api error Code: Message". Every place that turns an AWS or Kubernetes error into text goes through Name, Message or Said.

Ports the name and message of the AWS SDK for JavaScript v3's service exceptions (@smithy/core decorateServiceException) and of the router's KubernetesError (lambda/src/lib/k8s.mjs).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cause

func Cause(err error) error

Cause is err without the wrappers the AWS SDK for Go puts around a credential provider's error: the failed operation's ("operation error STS: GetCallerIdentity, "), the signer's ("get identity: ", "get credentials: ") and the credential cache's ("failed to refresh cached credentials, "). What remains is the provider's own error with everything below it, as Node's err.message gives the provider's words: an expired SSO session, "the SSO session has expired or is invalid"; a credential_process that fails, "process provider error: error in credential_process: exit status 1"; a call that failed after its retries, "exceeded maximum number of attempts, 3, …". Anything else is kept whole: an AWS API error, which Name and Message read already, is returned as it is; a prefix (Prefixed) is kept.

func Message

func Message(err error) string

Message is err.message as Node gives it: an AWS error's message (smithy's ErrorMessage; UnknownError when the API gave none, as the Node SDK says), a Kubernetes error's message, else Error(). A prefixed error's message is its prefix, ": " and its error's message.

func Name

func Name(err error) string

Name is err.name as Node gives it: an AWS error's code (smithy's ErrorCode), a Kubernetes error's name (KubernetesError), else Node's generic Error.

func Prefix

func Prefix(err error) string

Prefix is the prefix of a prefixed error (Prefixed), such as the profile that failed among several; "" for none.

func Prefixed

func Prefixed(prefix string, err error) error

Prefixed is err with its message prefixed, as Node's err.message = `${prefix}: ${err.message}` (such as the profile whose SSO session expired); its name and the error it wraps are kept.

func SSOToken

func SSOToken(err error) bool

SSOToken says err is an SSO token error that `aws sso login` cures: the SSO session expired or invalid (the SDK's ssocreds.InvalidTokenError, a profile with its own sso_start_url), or the SSO token provider's expired, missing or unreadable token (an sso-session profile), wrapped or prefixed.

func Said

func Said(err error) string

Said is `${err.name}: ${err.message}`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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