The documentation on invokeRemote https://developer.atlassian.com/platform/forge/apis-reference/ui-api-bridge/invokeRemote/ is pretty sparse of details on the actual errors thrown by the invokeRemote.
I would like to categorize errors in:
- Timeout ( That’s possible, as I get an error with a
Remote invocation timed out message)
- Response size over the limit (I get a generic
An error occurred while trying to invoke )
- Rate limit hit (I don’t even know how to trigger this)
- … other unknown error
What are my options?
I think you need to look at the limitation of Forge to understand what you can really do.
Hi, I understand the limitations of the forge platform.
I was more curious on how to surface the exact limitation that was hit to my users.
For instance:
- If the rate limit was hit: “Please retry in a few minutes”
- If the response body was too big: “Please try to restrict your search query”
Rate limiting can be a tricky topic. In your case, the best approach is to capture the specific exception thrown by Forge. Atlassian provides a list of these errors, so you can handle them in a try...catch block and use a notification flag (or similar mechanism) to surface the error.
That said, from a user’s perspective, the underlying reason, whether it’s a rate limit or something else, shouldn’t really matter. Users generally expect the app to respond with a clear and understandable message.
Instead of exposing the raw Forge error, it’s better to rewrite the message into something more user-friendly that explains what happened and what the user should do next. This provides a better experience than showing the direct error returned by Forge.