Skip to content

Add ConnectionNotFoundError to the TypeScript SDK - #71375

Merged
guan404ming merged 1 commit into
apache:mainfrom
jason810496:feature/ts-sdk/connection-not-found
Aug 11, 2026
Merged

guan404ming merged 1 commit into
apache:mainfrom
jason810496:feature/ts-sdk/connection-not-found

Conversation

@jason810496

Copy link
Copy Markdown
Member

Why

The TS SDK TaskClient exposes both getVariable (returns null) and getVariableOrThrow (raises VariableNotFoundError), but Connections only had the null-returning getConnection, so a task that requires a Connection has to hand-write the absence check and has no typed error to catch.

How

  • getConnectionOrThrow is a thin wrapper over getConnection, exactly how getVariableOrThrow wraps getVariable.
  • Purely additive: getConnection keeps its null-returning contract, and no wire protocol changes.
  • Mirrors the Go SDK, which already ships a ConnectionNotFound sentinel next to VariableNotFound.

Was generative AI tooling used to co-author this PR?

Variable lookups already offer both shapes: getVariable returns null and
getVariableOrThrow raises a typed error. Connections only had the
null-returning half, so a task that genuinely requires a Connection had to
hand-write the absence check and had no error type to catch. The Go SDK
already exposes a ConnectionNotFound sentinel next to VariableNotFound.
@jason810496 jason810496 moved this from Backlog to In review in TS-SDK Aug 11, 2026
@guan404ming
guan404ming merged commit fe9ca48 into apache:main Aug 11, 2026
89 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in TS-SDK Aug 11, 2026
dabla pushed a commit to dabla/airflow that referenced this pull request Aug 14, 2026
Variable lookups already offer both shapes: getVariable returns null and
getVariableOrThrow raises a typed error. Connections only had the
null-returning half, so a task that genuinely requires a Connection had to
hand-write the absence check and had no error type to catch. The Go SDK
already exposes a ConnectionNotFound sentinel next to VariableNotFound.
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Sep 11, 2026
Variable lookups already offer both shapes: getVariable returns null and
getVariableOrThrow raises a typed error. Connections only had the
null-returning half, so a task that genuinely requires a Connection had to
hand-write the absence check and had no error type to catch. The Go SDK
already exposes a ConnectionNotFound sentinel next to VariableNotFound.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants