NEW ERROR HANDLING INFRASTRUCTURE

Topics: Developer Forum
Developer
Dec 30, 2006 at 1:19 AM
There are new properties on PscxCmdlet. ErrorHandler should be used for writing normal errors and for throwing terminating errors; you should not need to call the PscxErrorRecord under normal conditions yourself.

Please add these two methods for any potentially reusable error record that you create.

And since file reading is quite common in our project, there is the FileHandler which opens a Stream or a StreamReader, calls your delegate, and handles the errors that might occur.

I've updated the PSCX Developer's Guide to reflect the changes.
Coordinator
Dec 30, 2006 at 6:47 PM
So I'm not seeing the value of a separate PscxErrorRecord class. If I add a new type of error, there's two files I have to update. Why not just put the ErrorRecord creation code in PscxCmdlet.IPscxErrorHandler.cs impl?
Coordinator
Dec 30, 2006 at 6:48 PM
One other thing, shouldn't we use globalized strings for the error messages also?
Coordinator
Dec 30, 2006 at 7:09 PM
Regarding, PscxErrorRecord/Exception, at the very least could we move these to the Internal dir so they are right there beside IPscxErrorHandler?