The main question is simple. I have a c# dll I created to act as a plugin for an access solution. What would be a proper OO design pattern for returning error information from the dll to the solution?
I know I use to use things like SetLastError for dlls written in C, however this does not seem to be the optimum solution for an OO pattern. The basic setup is I have a class written in VBA which calls methods within the dll. The methods return true or false depending on whether or not they worked. I would like to be able to get more information as to the nature of the failure if the methods returned false however.
Code:Interface IMyClass { bool MyMethod(); } Class MyClass : IMyClass { public bool myMethod() { if(MyOtherMethod() != null) { return true; } else { return false; } } private dataType MyOtherMethod() { try { dosomething; return dataType; } catch(someException e) { //how do I return this information return null; } } }