| 513 | it.effect("error/schema", () => |
| 514 | Effect.gen(function*() { |
| 515 | class CustomError extends Schema.Error<CustomError>("CustomError")({ |
| 516 | _tag: Schema.tag("CustomError"), |
| 517 | name: Schema.String |
| 518 | }) { |
| 519 | [HttpServerRespondable.symbol]() { |
| 520 | return HttpServerResponse.schemaJson(CustomError)(this, { status: 599 }) |
| 521 | } |
| 522 | } |
| 523 | yield* HttpRouter.add("GET", "/home", new CustomError({ name: "test" })).pipe( |
| 524 | HttpRouter.serve, |
| 525 | Layer.build |