I want to known the best way to handle database exceptions and display messages back to the user. I have been looking at messages.add_message
in my views using a try.
For example:
The following error (1062, "Duplicate entry '123321' for key 'PRIMARY'")
. Display back to the user friendly message: "Error uploading CSV Duplicate entries"
Is the the recommended way?
Are there any good tutorials on error handling (i.e. blog posts) that you would recommend as a good approach?