H
hansiman
I'm unsure how best to handle errors in the scenario below!
Say I have a class Employee that handles everything about employees.
The class has two properties "id" and "name", and on procedure
"create" that simply inserts a new employee into the database.
Any error I'd like to show to the user. But how do I make an error
that occurs in the class display in the code that calls the class?
Should I have try catch in both the class (wrapping the ado code) and
in the calling code (wrapping the Employee.Create)?
Say I have a class Employee that handles everything about employees.
The class has two properties "id" and "name", and on procedure
"create" that simply inserts a new employee into the database.
Any error I'd like to show to the user. But how do I make an error
that occurs in the class display in the code that calls the class?
Should I have try catch in both the class (wrapping the ado code) and
in the calling code (wrapping the Employee.Create)?