Error handling part 6: ETW logging example

<< Part5 I want to show an example of how to do the error logging through ETW, for the error objects described in the Part 5. It goes against some of the commonly accepted ETW principles but I think that it would out better this way. I think that these commonly accepted ETW principles are…

0

reporting the nested errors in PowerShell

A pretty typical pattern for PowerShell goes like this: …allocate resource… try {   … process resource … } finally {   …deallocate resource… } It makes sure that the resource gets properly deallocated even if the processing fails. However there is a problem in this pattern: if the finally block gets called on exception…

0

getting a stack trace in PowerShell

One of the most annoying “features” of PowerShell is that when the script crashes, it prints no stack trace, so finding the cause of the error is quite difficult. The exception object System.Management.Automation.ErrorRecord actually has the property ScriptStackTrace that contains the trace, it’s just that the trace doesn’t get printed on error. You can wrap…

0

Error handling, part 5: an error infrastructure for Windows

<<Part 4  Part 6>> Overview The first error infrastructure I’ve done was for my Triceps project. Its description can be found in the Triceps manual. It has proven itself so convenient and useful that I wanted something similar on Windows. And that Windows implementation is what I want to describe here. Some of the features…

0

Error handling, part 4: error information recap

<<Part 3 Part 5>> Picking up again the series on the error handling, here is the summary of what a good error handling system should contain and do (starting with a recap of the previous posts and then going further): Errors should be nestable, with the high-level information on top and the full details on the bottom. Errors…

0

Error handling, part3: the ETW way

<< Part 2 Part 4>> The Part 2 ended with the summary: In a good error reporting system, the errors should have both the types/codes for the automatic handling and the free-form human-readable strings with the detailed description. However there is one more way, a sort of “middle” way, that is used by the Event Tracing…

0

Error handling, part 2: error types

<< Part 1  Part3 >> Over the years I’ve seen various error handling conventions and systems, and even have written a couple of them myself. I’ve done one for Triceps, with support for C++ and Perl, and another one for C++ on Windows, that I plan to show and discuss in detail in the later…

0

Error handling, part 1: how not to

Part 2>> With this post I start the series on how to handle the errors right. I’ve been thinking and experimenting with how to do it better, and I want to share this knowledge. First of all, I want to give an example with the error handling that was done wrong, unfortunately something that happens…

0