Skip to content

Throw AdapterError instead of Error when variable env var is missing#766

Merged
dskloetc merged 1 commit intomainfrom
kloet/var-env-var-error
May 8, 2026
Merged

Throw AdapterError instead of Error when variable env var is missing#766
dskloetc merged 1 commit intomainfrom
kloet/var-env-var-error

Conversation

@dskloetc
Copy link
Copy Markdown
Contributor

@dskloetc dskloetc commented May 8, 2026

Description

Most errors thrown in src/config/index.ts are thrown during adapter initialization.
But the error that's thrown when a required variable env var is missing, is likely to be thrown during request validation.
By making it an AdapterError instead of Error, the adapter will returns a proper json response with statusCode instead of just a string.

Changes

Throw AdapterError instead of Error when a required variable env var is missing when requested.

Testing

Used with proof-of-reserves-v2 in the EA repo.

@dskloetc dskloetc added the patch label May 8, 2026
@dskloetc dskloetc marked this pull request as ready for review May 8, 2026 08:13
@dskloetc dskloetc requested a review from a team as a code owner May 8, 2026 08:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

NPM Publishing labels 🏷️

🟢 This PR has valid version labels and will cause a patch bump.

@dskloetc dskloetc merged commit 9649824 into main May 8, 2026
18 of 19 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

🚀 Successfully created version bump PR: #767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants