MCPcopy Create free account
hub / github.com/Effect-TS/effect / wrap

Method wrap

packages/effect/src/http-api/HttpApiError.ts:744–751  ·  view source on GitHub ↗
(
    kind: HttpApiSchemaError["kind"],
    effect: Effect.Effect<A, Schema.SchemaError, R>
  )

Source from the content-addressed store, hash-verified

742 }
743
744 static wrap<A, R>(
745 kind: HttpApiSchemaError["kind"],
746 effect: Effect.Effect<A, Schema.SchemaError, R>
747 ): Effect.Effect<A, HttpApiSchemaError, R> {
748 // Decoders return completed Exit values for synchronous results, so map
749 // eagerly and skip the error wrapper when nothing remains to run.
750 return Effect.mapErrorEager(effect, (error) => new HttpApiSchemaError({ kind, cause: error }))
751 }
752
753 readonly name = "HttpApiSchemaError"
754 readonly message = this.kind;

Callers 7

KeyWrap.test.tsFile · 0.80
wrapRawFunction · 0.80
handlerToHttpEffectFunction · 0.80
makeFunction · 0.80
activityFunction · 0.80

Calls

no outgoing calls

Tested by 1

wrapRawFunction · 0.64