Hello,
I have some validations to some fields in the beforeSave hook and if the validation fails I want the error message to be show to the user in the UI.
I have the following code in the beforeSave hook function:
This was working fine in ESPO Version 6.1.0 but after I upgraded to 7.0.10, I just get an "Error Occurred" message in the UI and not my custom error message.
The logs under data/logs shows the errors just like before and even in the browser dev tools everything looks fine.
Was there any change done to the error handling in ESPO 7? What am I doing wrong?
item Any ideas?
I have some validations to some fields in the beforeSave hook and if the validation fails I want the error message to be show to the user in the UI.
I have the following code in the beforeSave hook function:
Code:
if ($entity->isAttributeChanged('stage') && in_array($entity->get('stage'), ['closed lost', 'disqualified']) && empty($entity->get('reasonForLoss'))) { throw new BadRequest('Reason for lost should be filled!!', 400); }
The logs under data/logs shows the errors just like before and even in the browser dev tools everything looks fine.
Was there any change done to the error handling in ESPO 7? What am I doing wrong?
item Any ideas?
Comment