Announcement

Collapse
No announcement yet.

How to show custom error message without error code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to show custom error message without error code

    I use the function " throw new BadRequest('my error message');

    But this one throws error along with the error code "Error:400".

    How i can remove the Error:400 from it or is there any other function to throw custom error without error code.

    Please help me on this , Thanks in advance

  • #2
    Hello,
    maybe :
    you return a value : myError=true

    and then on client side :

    Espo.Ui.notify('MyError', 'error', 2000);

    Simple for me

    Comment


    • #3
      Hi Thanks for the response , but i didnt get you clearly

      In my controller function i try to check a conditional throw error

      public function actionDelete($params, $data, $request) {
      try {

      if($result_number_column['count(*)'] > 0)
      {
      throw new BadRequest('schedule which has delivery form cannot be deleted');
      }

      } catch (Exception $ex) {
      throw new Error("Error while delete a proposal.");
      }
      return parent::actionDelete($params, $data, $request);
      }

      I get an error alert like this please find the attachment. in that alert i need to remove "Error:400"

      Attached Files

      Comment

      Working...
      X