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 ¶
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 ¶
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 ¶
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 ¶
Prefix is the prefix of a prefixed error (Prefixed), such as the profile that failed among several; "" for none.
func Prefixed ¶
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 ¶
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.
Types ¶
This section is empty.