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">
   <code>005056A509B11ED1B9BF9F46AA8E82ED</code>
   <message xml:lang="en">In the context of Data Services an unknown internal server error occured</message>
</error>

How to handle that?

1 answer