✅ Catching different errors using System.Data.SQLite
so I'm wanting to write a custom class that error handles my database. For example:
I would somehow (idk how) use the class within the code above for adding a new user to the database. In the create database function, the Username field is unique. A user tries to create a new account with a username that already exists. I would like for the process to be something like
I would somehow (idk how) use the class within the code above for adding a new user to the database. In the create database function, the Username field is unique. A user tries to create a new account with a username that already exists. I would like for the process to be something like
- user clicks create user button call database function
- database tries to save -> send error to custom error handler class
- function for unique errors sends back some type of value to the View for the user to tell them that the username already exists and to try again