How to show custom message on pop up for MySQL error?

Hi Community,

I want to show my own customised message popup to be shown if in case of MySql error

OperationalError: (1048, "Column 'id' cannot be null")



You can catch the exception in try … except block and then you can use the frappe.throw("Your Message") method to display pop up message