© 2026 Hedgehog Software, LLC
new HttpApiError.NotFound()
NotFound
Effect.Effect<never, NotFound>
const mapError = (value: string): HttpApiError.NotFound | HttpApiError.BadRequest => pipe( Match.value(value), Match.withReturnType<HttpApiError.NotFound | HttpApiError.BadRequest>(), Match.when("missing", () => new HttpApiError.NotFound()), Match.orElse(() => new HttpApiError.BadRequest()) ) Type 'Effect<never, BadRequest | NotFound, never>' is not assignable to type 'BadRequest | NotFound'
const mapError = (value: string): HttpApiError.NotFound | HttpApiError.BadRequest => pipe( Match.value(value), Match.withReturnType<HttpApiError.NotFound | HttpApiError.BadRequest>(), Match.when("missing", () => new HttpApiError.NotFound()), Match.orElse(() => new HttpApiError.BadRequest()) ) as HttpApiError.NotFound | HttpApiError.BadRequest