Skip to content

Commit

Permalink
readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Aston committed Oct 2, 2011
1 parent 2775515 commit 86250de
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion readme.md
@@ -1,4 +1,39 @@
NHelpfulException
====

A simple wrapper for System.Exception to help make exceptions more meaningful.
A simple wrapper for System.Exception to help make exceptions more meaningful.

Usage:
--------
**1. Create your HelpfulException**

```C#

public class MyHelpfulException : HelpfulException
{
public MyHelpfulException(string problemDescription,
string[] resolutionSuggestions = default(string[]),
Exception innerException = default(Exception))
: base(problemDescription, resolutionSuggestions, innerException) {}
}

```

**2. Instantiate and throw the exception**

```C#

throw new MyHelpfulException("Coffee supply too low.", new []{ "Buy some more coffee.", "Stop drinking so much coffee." });

```

**3. Bask in the glory of a meaningful exception message

```
Coffee supply too low.
Suggestions:
- Buy some more coffee.
- Stop drinking so much coffee.
```

0 comments on commit 86250de

Please sign in to comment.