处理和抛出异常
try
{
}
catch (System.Exception e)
{
throw new System.Exception("error",e);
}
catch
{
throw;
}
finally
{
}
抛出异常
throw e;
自定义异常
public class WidgetException:System.ApplicationException
{
Widget mWidget;
public Widget ErrorWidget
{
get
{
return mWidget;
}
}
public WidgetException(Widget W, string s) :base(S)
{
mWidget = w;
}
}
{
}
catch (System.Exception e)
{
throw new System.Exception("error",e);
}
catch
{
throw;
}
finally
{
}
抛出异常
throw e;
自定义异常
public class WidgetException:System.ApplicationException
{
Widget mWidget;
public Widget ErrorWidget
{
get
{
return mWidget;
}
}
public WidgetException(Widget W, string s) :base(S)
{
mWidget = w;
}
}