Hi!How can I capture the error message that a trigger in the database gives me when trying to insert a record.
Thanks!
GDongo.-
During development, you may simply enable Debug. During production, you may enable Log error to file.
Thank you, but that’s not what I need. The trigger makes a series of validations and I need to inform the user in a message why their record was not recorded. This reason comes in the trigger message. Example: “There are no professionals available…”. I do not do the validation in the application because they are much more complex than what I describe, and they are validations shared by several other applications and they are dynamic business rules that it is convenient for me to centralize in one place.
Then you may need to use the more advanced Doctrine middlewares and write your exec()
method to catch the error.
Thanks! I’m going to look into that.