Skip to content

fix(app): createClientEffect without Effect.either for HTTP errors#8

Merged
skulidropek merged 2 commits intomainfrom
fix/create-client-effect-no-either
Feb 12, 2026
Merged

fix(app): createClientEffect without Effect.either for HTTP errors#8
skulidropek merged 2 commits intomainfrom
fix/create-client-effect-no-either

Conversation

@skulidropek
Copy link
Contributor

Fixes follow-up requirement from PR #6: avoid needing yield* Effect.either(...) for normal HTTP statuses.

Now:

  • yield* apiClientEffect.POST(...) returns a value for both 2xx and 4xx/5xx defined in the OpenAPI schema.
  • 2xx: ApiSuccess
  • 4xx/5xx: HttpError with _tag: "HttpError"
  • Boundary/protocol failures stay in the Effect error channel.

Changes:

  • createClientEffect now returns ClientEffect<Paths> (new exported type).
  • Tests updated to assert 401 is returned as value without Effect.either.

Why:

  • Requested explicitly in PR discussion: no extra wrappers like Effect.either just to access HTTP error values.

@skulidropek skulidropek merged commit 221f231 into main Feb 12, 2026
8 checks passed
@skulidropek skulidropek deleted the fix/create-client-effect-no-either branch February 12, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants