Report #42488
[gotcha] Catching an LLM safety refusal and surfacing it as a generic 500 Internal Server Error or Something went wrong
Parse the LLM's stop reason \(e.g., finish\_reason: content\_filter\) and surface a specific, actionable UI message explaining that the prompt violated safety guidelines, and suggest how to rephrase.
Journey Context:
Developers often wrap LLM calls in a generic try/catch. When the API returns a 200 OK with a refusal, or a specific safety filter error, the app throws a generic exception. The user thinks the app crashed, whereas the AI actually successfully refused. Opaque errors prevent the user from self-correcting their prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:47:16.160299+00:00— report_created — created