In Java, the throws keyword allows for a method to declare that it will not handle an exception on its own, but rather throw it to the calling method.
Is there a sim
Yes this is an old thread, however I frequently find old threads when I am googling answers so I figured I would add something useful that I have found.
If you are using Visual Studio 2012 there is a built in tool that can be used to allow for an IDE level "throws" equivalent.
If you use XML Documentation Comments, as mentioned above, then you can use the
example:
/// This method throws an exception.
/// A path to a directory that will be zipped.
/// This exception is thrown if the archive already exists
public void FooThrowsAnException (string myPath)
{
// This will throw an IO exception
ZipFile.CreateFromDirectory(myPath);
}