@vizamodo/aws-sts-core 0.4.27 → 0.4.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/sts/issue.js +12 -5
  2. package/package.json +1 -1
package/dist/sts/issue.js CHANGED
@@ -139,11 +139,18 @@ export async function issueAwsCredentials(input) {
139
139
  "Authorization": `${ALGORITHM} Credential=${certSerialDec}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signatureHex}`,
140
140
  });
141
141
  const issuedAt = Date.now();
142
- const res = await fetch(`https://${host}${PATH}`, {
143
- method: "POST",
144
- headers: finalHeaders,
145
- body,
146
- });
142
+ let res;
143
+ try {
144
+ res = await fetch(`https://${host}${PATH}`, {
145
+ method: "POST",
146
+ headers: finalHeaders,
147
+ body,
148
+ });
149
+ }
150
+ catch (err) {
151
+ console.warn("[aws-unreachable]", { region, error: err?.message });
152
+ throw new InternalError("aws_unreachable");
153
+ }
147
154
  if (!res.ok) {
148
155
  console.warn("[aws-rejected]", { status: res.status, region, profile });
149
156
  throw new InternalError("aws_rejected");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizamodo/aws-sts-core",
3
- "version": "0.4.27",
3
+ "version": "0.4.28",
4
4
  "description": "Pure AWS STS + SigV4 (X509 Roles Anywhere) core logic",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",