We need to ensure that the chat service returns those errors to Lightning in a fairly responsible way. Ie, with a decent HTTP status code and with a human readable error.
I'd suggest an error structure like this maybe, as the JSON payload:
error: 'LIMIT_EXCEEDED',
message: 'Usage Limit Exceeded',
fix: 'Try again tomorrow or contact your system administrator
I suppose the chat service shouldn't assume it's being called by lightning, but it should still return a good human readable error.
When calling out to anthropic, there are a bunch of errors we might get:
We need to ensure that the chat service returns those errors to Lightning in a fairly responsible way. Ie, with a decent HTTP status code and with a human readable error.
I'd suggest an error structure like this maybe, as the JSON payload:
I suppose the chat service shouldn't assume it's being called by lightning, but it should still return a good human readable error.