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

Function runSync

packages/effect/src/SchemaParser.ts:1106–1113  ·  view source on GitHub ↗
(effect: Effect.Effect<T, SchemaIssue.Issue>, message: string)

Source from the content-addressed store, hash-verified

1104}
1105
1106function runSync<T>(effect: Effect.Effect<T, SchemaIssue.Issue>, message: string): T {
1107 const exit = Effect.runSyncExit(effect)
1108 if (Exit.isSuccess(exit)) {
1109 return exit.value
1110 }
1111 const issue = InternalSchemaCause.getSchemaIssueOrThrow(exit.cause, message)
1112 throw new Error("Schema validation failed", { cause: issue })
1113}
1114
1115const constructorDefectMessage = "Constructor adapter can only throw schema issues"
1116

Callers 3

asSyncFunction · 0.70
constructSyncFunction · 0.70
NodeRedis.tsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected