Skip to content

Instantly share code, notes, and snippets.

View yeasin90's full-sized avatar
:octocat:

Yeasin Abedin yeasin90

:octocat:
View GitHub Profile
@yeasin90
yeasin90 / gist:88992e5375e5eff062dc
Created November 3, 2014 20:23
Common method for handling all C# exceptions
public class MyClass
{
private void Test(string param)
{
if (string.IsNullOrWhiteSpace(param))
throw new ArgumentNullException("Null Ex");
else if (param.Length > 1)
throw new ArgumentException("Arg Excp");
else if (param.Length > 5)
throw new OverflowException();