ontocast.api.responses¶
JSON error bodies for HTTP routes (keeps FastAPI handlers thin).
document_conversion_error_response(error, stage)
¶
422 when an uploaded document could not be converted.
Both /process and /process_unit answer this way; previously only /process_unit did, so the same unreadable file produced 422 on one route and 500 on the other.
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
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_empty_response(error)
¶
422 when a section selection matched nothing in this document.
Not 400: the parameters are individually well-formed and only fail against this particular document once it has been classified — the same unprocessable-entity reading a conversion failure gets.