WebClient change listener error messages

I have a listener that

onDelete(Invoice entity...

xeroService.deleteXeroInvoice(Invoice entity)

I don’t want to delete an invoice out of my system unless it was successfully deleted from Xero first.

If the invoice cannot be deleted in xero it will throw back an error like so:

> XeroApiException: {
>   "ErrorNumber": 10,
>   "Type": "ValidationException",
>   "Message": "A validation exception occurred",
> ...
>  "ValidationErrors": [
>         {
>           "Message": "Invoice not of valid status for modification"
>         },
>         {
>           "Message": "This document cannot be edited as it has a payment or credit note allocated to it."
>         }
>       ]

is it possible to have the webClient show just the validation errors as an easy to read message instead of the whole stacktrace as pictured here:
xeroError

How would I go about that?

Hi,
You can process the exception in the client exception handler and show user-friendly notification from its code:
https://doc.cuba-platform.com/manual-7.1/exceptionHandlers.html