Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 build Update of NUnit reference. June 20, 2012
Octocat-spinner-32 src Strongly sign project July 30, 2012
Octocat-spinner-32 .gitignore Git ignore mod. October 02, 2011
Octocat-spinner-32 COPYING wip January 27, 2012
Octocat-spinner-32 COPYING.LESSER wip January 27, 2012
Octocat-spinner-32 readme.md wip January 27, 2012
readme.md

NHelpfulException

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

Usage:

1. Create your HelpfulException


    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


    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.

License & Copyright

This software is released under the GNU Lesser GPL. It is Copyright 2011, Ben Aston. I may be contacted at ben@bj.ma.

Something went wrong with that request. Please try again.