• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

FreeTrainの進化系を目指す


Commit MetaInfo

Revision8 (tree)
Time2013-12-30 19:03:32
Authorc477

Log Message

例外処理の改善と条件付リソース(オーバーライド)の基本インターフェース

Change Summary

Incremental Difference

--- starter/Starter.cs (revision 7)
+++ starter/Starter.cs (revision 8)
@@ -24,7 +24,8 @@
2424 try {
2525 run(args);
2626 } catch (Exception e) {
27- UIUtil.ShowException("エラーが発生しました", e, UIInformLevel.normal);
27+ if(UIUtil.ShowException("エラーが発生しました", e, UIInformLevel.normal))
28+ throw;
2829 }
2930 }
3031 }
@@ -35,7 +36,8 @@
3536 }
3637
3738 static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) {
38- UIUtil.ShowException(e.Exception.Message, e.Exception, UIInformLevel.severe);
39+ if(UIUtil.ShowException(e.Exception.Message, e.Exception, UIInformLevel.severe))
40+ throw e.Exception;
3941 }
4042 }
4143 }
--- ui_jp/ui/system/ErrorMessageBox.cs (revision 7)
+++ ui_jp/ui/system/ErrorMessageBox.cs (revision 8)
@@ -21,10 +21,10 @@
2121 /// Displays a dialog box and returns after the dialog is closed.
2222 /// </summary>
2323 /// <param name="owner">can be null.</param>
24- public static bool Show( IWin32Window owner, string msg, Exception e ) {
24+ public static DialogResult Show(IWin32Window owner, string msg, Exception e) {
2525 using( Form f = new ErrorMessageBox(msg,e) ) {
2626 DialogResult res = f.ShowDialog(owner);
27- return (res == DialogResult.Abort);
27+ return res;
2828 }
2929 }
3030
@@ -188,6 +188,7 @@
188188 // throwButton
189189 //
190190 this.throwButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
191+ this.throwButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
191192 this.throwButton.Location = new System.Drawing.Point(190, 220);
192193 this.throwButton.Name = "throwButton";
193194 this.throwButton.Size = new System.Drawing.Size(134, 23);
@@ -194,7 +195,6 @@
194195 this.throwButton.TabIndex = 7;
195196 this.throwButton.Text = "再throw(開発用)";
196197 this.throwButton.UseVisualStyleBackColor = true;
197- this.throwButton.Click += new System.EventHandler(this.throwButton_Click);
198198 //
199199 // abortButton
200200 //
@@ -238,8 +238,7 @@
238238 }
239239
240240 private void throwButton_Click(object sender, EventArgs e) {
241- Debug.WriteLine(detail.Text);
242- throw exception;
241+
243242 }
244243 }
245244 }