Relative Content

Tag Archive for exception-handling

How much data should exceptions hold?

Almost all the exceptions I have ever written have been very lightweight, containing a String message and optionally a throwable. In some situations I have included some application specific enum or some other field.

How much data should exceptions hold?

Almost all the exceptions I have ever written have been very lightweight, containing a String message and optionally a throwable. In some situations I have included some application specific enum or some other field.

Java-Like ‘throws’-information in method signature C#

From Java I know that the signatures of methods that can throw exceptions contain a throws block, that contains the Exception(s) that might be thrown.
In C# there is no such thing and it is also not common practice to include such info in the XML-Header.
Is there a generally accepted way of drawing attention to potential exceptions or a place to commonly denote them?