Skip to content

v0.1.4: Three API error-handling fixes

Choose a tag to compare

@cyanheads cyanheads released this 07 Jun 06:32
v0.1.4
6772323

Three API error-handling fixes

fema_get_disaster and fema://disaster/{number} now short-circuit for
disaster numbers above 32767 (OpenFEMA Int16 ceiling), returning a clean
not_found instead of a raw type-mismatch API error. (#2)

The service layer sanitizes all 400 responses: Int16 overflow messages
become actionable range errors; other OData parse errors strip internal
position offsets and undefined codes. (#4)

No-results recovery hints for fema_search_disasters,
fema_get_public_assistance, and fema_get_housing_assistance are now
embedded in data.recovery.hint so structuredContent consumers receive
them (ctx.enrich.notice is unreachable on the error path). (#3)

Fixed:

  • fema_get_disaster / fema://disaster/{number}: Int16 range guard — numbers > 32767 return not_found without calling the API (#2)
  • fema_search_disasters / fema_get_public_assistance / fema_get_housing_assistance: recovery guidance now in data.recovery.hint, present in structuredContent (#3)
  • fema_query_dataset: raw OData 400 errors sanitized into actionable messages before surfacing to callers (#4)

50 tests pass; bun run devcheck clean.