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

Function ndjsonSchemaError

packages/effect/src/http-api/HttpApiClient.ts:1470–1479  ·  view source on GitHub ↗
(error: Ndjson.NdjsonError)

Source from the content-addressed store, hash-verified

1468 Ndjson.isNdjsonError(error) && error.kind === "Pack"
1469
1470const ndjsonSchemaError = (error: Ndjson.NdjsonError): Schema.SchemaError =>
1471 new Schema.SchemaError(
1472 new SchemaIssue.InvalidValue({
1473 message: error.reason === "InvalidUtf8"
1474 ? "Expected valid UTF-8"
1475 : error.unterminated
1476 ? "Expected a valid JSON line, got an unterminated final line"
1477 : "Expected a valid JSON line"
1478 })
1479 )
1480
1481function makeSseDecoder(
1482 declaration: HttpApiSchema.StreamSse<Sse.EventCodec, Schema.Constraint, unknown>,

Callers 1

makeStreamBodyDecoderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected