()
| 444 | |
| 445 | private textEffect: Effect.Effect<string, Error.HttpServerError> | undefined |
| 446 | get text(): Effect.Effect<string, Error.HttpServerError> { |
| 447 | if (this.textEffect) { |
| 448 | return this.textEffect |
| 449 | } |
| 450 | this.textEffect = Effect.runSync(Effect.cached( |
| 451 | Effect.tryPromise({ |
| 452 | try: () => this.source.text(), |
| 453 | catch: (cause) => |
| 454 | new Error.HttpServerError({ |
| 455 | reason: new Error.RequestParseError({ |
| 456 | request: this, |
| 457 | cause |
| 458 | }) |
| 459 | }) |
| 460 | }) |
| 461 | )) |
| 462 | return this.textEffect |
| 463 | } |
| 464 | |
| 465 | get json(): Effect.Effect<Schema.Json, Error.HttpServerError> { |
| 466 | return Effect.flatMap(this.text, (_) => |
no outgoing calls