ontocast.api.responses¶
JSON error bodies for HTTP routes (keeps FastAPI handlers thin).
Classes¶
Functions:¶
budget_failure(error)
¶
A document that reached its token cap before it finished (422).
error_details.run_meter carries the meter's usage at the refusal.
Source code in ontocast/api/responses.py
conversion_failure(error, stage)
¶
A document that could not be converted (its item answers 422).
Source code in ontocast/api/responses.py
missing_fixed_catalog_ontology_id_response()
¶
400 when ontology_context_mode is fixed_single_ontology but id is absent.
Source code in ontocast/api/responses.py
ontology_context_config_error_response(error)
¶
Source code in ontocast/api/responses.py
request_param_error_response(error)
¶
400 for any malformed request parameter.
Replaces the previous per-message special cases, under which every parameter error but one returned 500.
Source code in ontocast/api/responses.py
section_selection_failure(error)
¶
A section selection that matched nothing in this document (422).
Not 400: the parameters are individually well-formed and only fail against this particular document once it has been classified.