「トップページ/CSHARP/Exception」の編集履歴(バックアップ)一覧はこちら
追加された行は緑色になります。
削除された行は赤色になります。
|&big(){例外処理}|
#contents()
----
*独自の例外クラス
Exceptionクラスを継承する。
ほとんど中身は不要だが、継承元に引数を渡す為、コンストラクタのみ書く
/// <summary>FooBarの例外</summary>
public class FooBarException : Exception
{
/// <summary>FooBarExceptionコンストラクタ</summary>
public FooBarException() { }
/// <summary>FooBarExceptionコンストラクタ(string)</summary>
public FooBarException(string message)
: base(message) { }
/// <summary>FooBarExceptionコンストラクタ(string, Exception)</summary>
public FooBarException(string message, Exception innerException)
: base(message, innerException) { }
}
----
|&big(){例外処理}|
#contents()
----
*独自の例外クラス
Exceptionクラスを継承する。
ほとんど中身は不要だが、継承元に引数を渡す為、コンストラクタのみ書く
/// <summary>FooBarの例外</summary>
public class FooBarException : Exception
{
/// <summary>FooBarExceptionコンストラクタ</summary>
public FooBarException() { }
/// <summary>FooBarExceptionコンストラクタ(string)</summary>
public FooBarException(string message)
: base(message) { }
/// <summary>FooBarExceptionコンストラクタ(string, Exception)</summary>
public FooBarException(string message, Exception innerException)
: base(message, innerException) { }
}
----