2011年7月26日 星期二

[C#] Creating Custom Exceptions

Good reference: Creating Custom Exceptions in .NET

As quoted:
“We added ApplicationException thinking it would add value by grouping exceptions declared outside of the .NET Framework, but there is no scenario for catching ApplicationException and it only adds unnecessary depth to the hierarchy. [...] You should not define new exception classes derived from ApplicationException; use Exception instead. In addition, you should not write code that catches ApplicationException.”
Maybe we should not use ApplicationException anymore.

沒有留言:

張貼留言