Skip to Content
0
Jul 24, 2017 at 07:34 AM

Suppress standard popover during oData error handling

252 Views Last edit Jul 24, 2017 at 07:38 AM 2 rev

Hello,

I'm implementing simple Fiori-like application and I have problem with oData error handling. It is based on WebIDE application template.

On the back-end system I throw business exception with some text, that I want to display on Fiori. Generally it is working fine, but there is still standard popover with message: "Sorry, a technical error occurred! Please try again later.", how can I suppress that?

Back-end code:

DATA:
  lo_message TYPE REF TO /iwbep/if_message_container,
  lx_bus_ex  TYPE REF TO /iwbep/cx_mgw_busi_exception.

lo_message = mo_context->get_message_container( ).
lo_message->add_message_text_only(
  iv_msg_type = /iwbep/if_message_container=>gcs_message_type-error
  iv_msg_text = 'Error text!' ).
   
CREATE OBJECT lx_bus_ex
  EXPORTING message_container = lo_message.

RAISE EXCEPTION lx_bus_ex.

Front-end code:

oModel.create("/ActionSet", oAction, {
  success: function() {
    // OK 
  },
  error: function(oError) {
    // Message is displayed 
    MessageToast.show(JSON.parse(oError.responseText).error.message.value);
  }
});

I would be grateful for any hint.

Kind regards,

Jakub

Attachments

screen.png (5.0 kB)