08/10/08 21:45:13
>>816
そういうこと
抜けるだけならreturnを使うけど、例外の時はthrowを使うという手段もある。
特に、その関数無いでは対処仕切れない場合とか、例外の再throwをすることがある。
string GetMessage()
{ try {...} catch (ry) { return " tell a lie :p";} }
より
{ try {...} catch (ry) { throw (new Exception("ごごご、ごめんなさい");} }
のほうが良い