A request part (Params, Headers, Query, Payload)
that did not decode, answered with 400 and not reported; or a
response part (Body, ResponseHeaders) that did not encode,
answered with 500 and reported.
Attributes#
| Attribute | Type | Description |
|---|---|---|
kind | SchemaErrorKind | |
cause | S.SchemaError | |
details | bool = field(default=False, kw_only=True, repr=False, compare=False) | The 400 sends |
report_ignored | bool = field(init=False, repr=False, compare=False) | |
message | str |
Functions#
__init__#
__init__(kind, cause, *, details=False) -> None| Parameter | Type | Description |
|---|---|---|
kind | SchemaErrorKind | |
cause | S.SchemaError | |
details | bool = False |
wrap#
wrap[A, R](kind, effect) -> Effect[A, HttpApiSchemaError, R]effect failing with this error of kind instead.
| Parameter | Type | Description |
|---|---|---|
kind | SchemaErrorKind | |
effect | Effect[A, S.SchemaError, R] |
Returns Effect[A, HttpApiSchemaError, R]
@staticmethod
def wrap[A, R](
kind: SchemaErrorKind, effect: Effect[A, S.SchemaError, R]
) -> Effect[A, HttpApiSchemaError, R]:
"""``effect`` failing with this error of ``kind`` instead."""
require_effect(effect, "effect")
return effect.map_error(lambda error: HttpApiSchemaError(kind, error))