ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 7 replies, has 2 voices, and was last updated by  zhex900 4 weeks ago.

  • Creator
    Topic
  • #35913

    zhex900
    Participant

    Hi,

    How do I create a custom widget error message?
    Screen_Shot_2017_08_10_at_12_33_28_pm
    I want to change this error message to something more meaningful.

    This is what I have now. But error message is only displayed after I refresh the page.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #37632
    ykasenka
    ykasenka
    Participant

    Hello

    By default, it is no possible to customize error message when server returns 500 code. Please wrap you code by try-catch and pass error message to your widget template.

    #37635
    ykasenka
    ykasenka
    Participant

    Example
    controller:

    twig:

    • This reply was modified 1 month ago by ykasenka ykasenka.
    #37637
    ykasenka
    ykasenka
    Participant

    @zhex900, did you get an answer to your question?

    #37639

    zhex900
    Participant

    I want to throw the exception other places not just in the controller. For example EventListeners, Managers. Where do I add the twig you suggested? Basically, I want to have a way to display error messages.

    #37645
    ykasenka
    ykasenka
    Participant

    For wrap exceptions for dialogs globally, you need create and register exception listener, like that:

    create you widget (extended from “oro/dialog-widget”), overwrite current logic, and register it instead of “oro/dialog-widget” on you bundle (see method _onContentLoadFail), like that:

    #37713
    ykasenka
    ykasenka
    Participant

    @zhex900, this time did you get an answer to your question?

    #37715

    zhex900
    Participant

    Yes. Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.