Handling OData Exceptions with Batch mode

I'm implementing SAPUI5 (Fiori like) application, that calls multiple CREATE operations in one batch. At now I've just redefined methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN / END and proper method is called multiple times. It is working fine when there is no errors.

How should I throw business exception in CREATE_ENTITY method to get message at ForntEnd layer? In console I can see only:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
   <message xml:lang="en">In the context of Data Services an unknown internal server error occured</message>

How to handle that?

1 answer