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

Function getErrorSchemas

packages/effect/src/unstable/httpapi/HttpApiEndpoint.ts:283–292  ·  view source on GitHub ↗
(endpoint: Top)

Source from the content-addressed store, hash-verified

281
282/** @internal */
283export function getErrorSchemas(endpoint: Top): Array<Schema.Top> {
284 const schemas = new Set<Schema.Top>(endpoint.error)
285 for (const middleware of endpoint.middlewares) {
286 const key = middleware as any as HttpApiMiddleware.AnyService
287 for (const schema of key.error) {
288 schemas.add(schema)
289 }
290 }
291 return Array.from(schemas)
292}
293
294/**
295 * A widened `HttpApiEndpoint` type used when the concrete method, path, schemas,

Callers

nothing calls this directly

Calls 1

addMethod · 0.65

Tested by

no test coverage detected