fix(service-auto): mapare ORA-01438 → 422 pentru ID invalid
ORA-01438 (value larger than column precision) apare când id_masiniclient depășește precizia coloanei Oracle. Este eroare de input, nu server error — mapăm la 422 Unprocessable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,10 @@ def _handle_oracle_error(e: Exception) -> NoReturn:
|
||||
clean = re.sub(r"^ORA-\d+:\s*", "", raw_message).strip()
|
||||
raise HTTPException(status_code=422, detail=clean)
|
||||
|
||||
if code == 1438:
|
||||
# ORA-01438: value larger than specified precision — bad input ID (e.g. id_masiniclient out of range)
|
||||
raise HTTPException(status_code=422, detail="Valoare invalidă pentru câmp (ID prea mare)")
|
||||
|
||||
if code in (12541, 12170, 12154, 12560):
|
||||
raise HTTPException(
|
||||
status_code=503,
|
||||
|
||||
Reference in New Issue
Block a user