[Monodevelop-patches-list] r2686 - in trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets: . Commands
Lluis Sanchez <lluis@ximian.com>
lluis at mono-cvs.ximian.com
Wed Jul 27 10:31:10 EDT 2005
Author: lluis
Date: 2005-07-27 10:31:10 -0400 (Wed, 27 Jul 2005)
New Revision: 2686
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/Commands/CommandManager.cs
Log:
2005-07-27 Lluis Sanchez Gual <lluis at novell.com>
* Commands/CommandManager.cs: Improve error message when an exception is
thrown while executing a command.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/ChangeLog 2005-07-26 22:23:55 UTC (rev 2685)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/ChangeLog 2005-07-27 14:31:10 UTC (rev 2686)
@@ -1,3 +1,8 @@
+2005-07-27 Lluis Sanchez Gual <lluis at novell.com>
+
+ * Commands/CommandManager.cs: Improve error message when an exception is
+ thrown while executing a command.
+
2005-07-13 Lluis Sanchez Gual <lluis at novell.com>
* BasicChart/*: A simple chart widget.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/Commands/CommandManager.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/Commands/CommandManager.cs 2005-07-26 22:23:55 UTC (rev 2685)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/Commands/CommandManager.cs 2005-07-27 14:31:10 UTC (rev 2686)
@@ -131,8 +131,9 @@
public bool DispatchCommand (object commandId, object dataItem)
{
+ ActionCommand cmd = null;
try {
- ActionCommand cmd = GetActionCommand (commandId);
+ cmd = GetActionCommand (commandId);
int globalPos;
object cmdTarget = GetFirstCommandTarget (out globalPos);
@@ -178,7 +179,8 @@
return cmd.DispatchCommand (dataItem);
}
catch (Exception ex) {
- ReportError (commandId, "Error while executing command: " + commandId, ex);
+ string name = (cmd != null && cmd.Text != null && cmd.Text.Length > 0) ? cmd.Text : commandId.ToString ();
+ ReportError (commandId, "Error while executing command: " + name, ex);
return false;
}
}
More information about the Monodevelop-patches-list
mailing list