on ‎2025 May 07 10:16 PM
I have a CAP and Fiori app. For a particular value help field, I call a REST API inside the handler on READ event of the field. In case the API responds in errors, I can see those errors only in the network tab. The ODATA API call still shows 200. How to propagate the exception to UI?
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi T1mey,
Thank you for your reply. I use Kotlin for Handlers and I use the req.err equivalent which is ServiceException. I use it as below
catch (e: RestClientResponseException) {
log.error { "Failed. Response: ${e.statusCode} ${e.responseBodyAsString}" }
if (e.statusCode == NOT_FOUND) {
messages.errorCode("notFound")
}
messages.errorCode("error", e.responseBodyAsString)
messages.throwIfError()
}
| User | Count |
|---|---|
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.