Skip to content

Effect.orElseSucceed anti-pattern in API error handling #59

Description

@dallenpyrah

Problem

File: src/parallel/api.ts (line 44)

.pipe(Effect.orElseSucceed(() => "Failed to read error response"))

This recovers errors by returning a default value, which can mask parsing errors. The actual API error message becomes "Failed to read error response" even for real API errors.

Proposed Fix

Use Effect.catchAll to properly handle the error chain while preserving error details:

.pipe(Effect.catchAll((e) => 
  Effect.succeed(`Failed to read error response: ${e.message}`)
))

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmediumMedium priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions