Repository navigation
fix(bb-app-setting): throw ParameterNotFound for missing parameters on AWS - #1142
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 3180892 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
belaboe
approved these changes
Nov 2, 2026
belaboe
left a comment
Contributor
There was a problem hiding this comment.
Thanks! This closes a real gap between the docs and the behavior, and the mapping looks right: branded, no enumerable cause, and other SDK errors still pass through. A few non-blocking notes:
- Now that the error is branded, its message goes over RPC. AuthBasic, for example, shows it to anonymous callers, so the SSM path (including a
fromExistingname like/prod/db/...) is visible where clients used to seeInternal error. Could the message usethis.fullId, as bb-secret does, or a fixed string? - Could you keep the SDK error as a non-enumerable
cause, like kv-store and knowledge-base do, so the requestId survives in server logs? - Changeset: maybe add a line for anyone who matched
e.name === 'ParameterNotFound', pointing them toisBlocksError(e, AppSettingErrors.ParameterNotFound). - Nits: the
get()JSDoc still says "guaranteed to exist", so it needs afromExisting/out-of-band caveat. Line 148 still callsgetSdkIdentifiers(). A name-only test case would cover the fallback branch.
harsh62
added a commit
that referenced
this pull request
Nov 6, 2026
Brings in 14 commits from main, among them "fix(core): return Invalid Request for a null JSON-RPC body" (#1143), "fix(core): reject non-JSON-RPC response bodies with ApiError" (#1171), "feat(bb-logger,core): backend Lambda log lines carry the invocation's requestId" (#1325), #1131, #1132, #1142, #1167, #1173, #1178, #1214, #494 and CI changes (#946, #970, #971). packages/core/src/client/index.test.ts and lambda-handler.test.ts: keep both sides' tests (this branch's httpErrorStatus, namespace identity and per-call fetch suites; main's non-JSON-RPC body and request id suites). packages/core/src/api.ts: the httpErrorStatus docs now say what the client does since #1171 when a Hosting error page replaces a 403 / 404: it rejects with a bare ApiError carrying the HTTP status, instead of response.json() throwing. # Conflicts: # packages/core/src/client/index.test.ts # packages/core/src/lambda-handler.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The README and
packages/bb-app-setting/src/types.tsdocument thatAppSetting.get()throwsAppSettingErrors.ParameterNotFoundwhen the parameter is missing. On AWS,get()inpackages/bb-app-setting/src/index.aws.tssentGetParameterCommandwithout catching anything, so a missing parameter (for example, one deleted out-of-band) surfaced as the SDK's rawParameterNotFoundexception.isBlocksError(e, AppSettingErrors.ParameterNotFound)was false, and because the error is not branded it crossed RPC as a generic 500 with no name.Issue #, if available:
Changes
packages/bb-app-setting/src/index.aws.ts:get()catches the SDKParameterNotFound(byinstanceof, falling back to the error name) and throws the brandedAppSettingErrors.ParameterNotFound. Other errors are rethrown unchanged.fromExisting()settings use the sameget().packages/bb-app-setting/src/index.aws.test.ts: tests for the mapping (branded and wire-safe) and for pass-through of other SDK errors..changeset/app-setting-aws-parameter-not-found.md: patch for@aws-blocks/bb-app-setting.Validation
maps the SDK ParameterNotFound to a branded AppSettingErrors.ParameterNotFoundfailed before the fix (AssertionError: got ParameterNotFound) and passes after.npm run build,@aws-blocks/bb-app-settingnpm test,npm run lint,npm run lint:deps: pass.npm test(all workspaces) andnpm run test:e2e:localfrom the repo root: pass.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.