public static isException ( object obj ) : bool | ||
obj | object | The object to check if it is an exception |
return | bool |
public static bool isException(object obj)
{
try
{
if (obj == null)
{
return false;
}
// TBD: should we really be checking the object's name? seems awfully kludgy. Maybe a better way to check
// if the object derives from the Exception class?
if (obj.GetType().Name.EndsWith("Exception"))
{
return true;
}
else
{
return false;
}
}
catch (Exception)
{
return false;
}
}