[mapguide-commits] r4933 - in trunk/Tools/Maestro: Maestro
Maestro/FusionEditor Maestro/LoginForm
Maestro/MaestroEditorInterface Maestro/PackageManager
Maestro/ResourceEditors
Maestro/ResourceEditors/FeatureSourceEditors/Gdal
Maestro/ResourceEditors/FeatureSourceEditors/ODBC
Maestro/ResourceEditors/FeatureSourcePreview
Maestro/ResourceEditors/LayerEditorControls
Maestro/ResourceEditors/LayerEditorControls/ScaleControls
Maestro/ResourceEditors/LayoutControls
Maestro/ResourceValidators MaestroAPI MgCooker
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Jun 3 20:06:47 EDT 2010
Author: jng
Date: 2010-06-03 20:06:46 -0400 (Thu, 03 Jun 2010)
New Revision: 4933
Added:
trunk/Tools/Maestro/MaestroAPI/NestedExceptionMessageProcessor.cs
Modified:
trunk/Tools/Maestro/Maestro/BoundsPicker.cs
trunk/Tools/Maestro/Maestro/EditorInterface.cs
trunk/Tools/Maestro/Maestro/FormExpression.cs
trunk/Tools/Maestro/Maestro/FormMain.cs
trunk/Tools/Maestro/Maestro/FusionEditor/ApplicationDefinitionEditor.cs
trunk/Tools/Maestro/Maestro/LengthyOperation.cs
trunk/Tools/Maestro/Maestro/LoginForm/FormLogin.cs
trunk/Tools/Maestro/Maestro/MaestroEditorInterface/IValidator.cs
trunk/Tools/Maestro/Maestro/PackageManager/AddResourceEntry.cs
trunk/Tools/Maestro/Maestro/PackageManager/CreatePackage.cs
trunk/Tools/Maestro/Maestro/PackageManager/PackageEditor.cs
trunk/Tools/Maestro/Maestro/Profiling.cs
trunk/Tools/Maestro/Maestro/Program.cs
trunk/Tools/Maestro/Maestro/ResourceEditorMap.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/CoordinateSystemOverride.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditorBase.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/Gdal/Composite.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/FeatureSourceEditorODBC.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourcePreview/SqlPreviewCtrl.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditor.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditorControls/ScaleControls/ConditionListButtons.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditorControls/VectorLayer.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutControls/InvokeURL.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutControls/SearchCommand.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutEditor.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/ResourceDataEditor.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/ThemeCreator.cs
trunk/Tools/Maestro/Maestro/ResourceProperties.cs
trunk/Tools/Maestro/Maestro/ResourceValidators/ApplicationDefinitionValidator.cs
trunk/Tools/Maestro/Maestro/ResourceValidators/FeatureSourceValidator.cs
trunk/Tools/Maestro/Maestro/ResourceValidators/MapDefinitionValidator.cs
trunk/Tools/Maestro/Maestro/ResourceValidators/WebLayoutValidator.cs
trunk/Tools/Maestro/Maestro/ValidationResults.cs
trunk/Tools/Maestro/MaestroAPI/HttpServerConnection.cs
trunk/Tools/Maestro/MaestroAPI/MgFeatureSetReader.cs
trunk/Tools/Maestro/MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
trunk/Tools/Maestro/MgCooker/SetupRun.cs
Log:
Added a new NestedExceptionMessageProcessor class to handle exception messages, including ones from within nested inner exceptions. Most exception handling code has been updated to use this class.
Modified: trunk/Tools/Maestro/Maestro/BoundsPicker.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/BoundsPicker.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/BoundsPicker.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro
{
@@ -80,7 +81,8 @@
}
catch(Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.BoundsPicker.BoundsDecodeError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.BoundsPicker.BoundsDecodeError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
Modified: trunk/Tools/Maestro/Maestro/EditorInterface.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/EditorInterface.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/EditorInterface.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -20,6 +20,7 @@
using System;
using System.Windows.Forms;
using System.Collections.Generic;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro
{
@@ -172,7 +173,8 @@
catch (Exception ex)
{
SetLastException(ex);
- MessageBox.Show(m_editor, string.Format(Strings.EditorInterface.DeleteResourceError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(m_editor, string.Format(Strings.EditorInterface.DeleteResourceError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
@@ -352,7 +354,8 @@
catch (Exception ex)
{
SetLastException(ex);
- MessageBox.Show(m_editor, string.Format(Strings.EditorInterface.SaveResourceError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(m_editor, string.Format(Strings.EditorInterface.SaveResourceError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
Modified: trunk/Tools/Maestro/Maestro/FormExpression.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/FormExpression.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/FormExpression.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -790,7 +790,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.FormExpression.ColumnValueError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.FormExpression.ColumnValueError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
Modified: trunk/Tools/Maestro/Maestro/FormMain.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/FormMain.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/FormMain.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Windows.Forms;
using System.Collections.Generic;
using System.Xml;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro
{
@@ -1069,7 +1070,8 @@
}
catch(Exception ex)
{
- MessageBox.Show(string.Format(Strings.FormMain.EditorLoadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(string.Format(Strings.FormMain.EditorLoadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
return;
}
@@ -1409,7 +1411,8 @@
catch (Exception ex)
{
LastException = ex;
- MessageBox.Show(this, string.Format(Strings.FormMain.SaveResourceError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.FormMain.SaveResourceError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -1887,8 +1890,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
LastException = ex;
- MessageBox.Show(this, string.Format(Strings.FormMain.PreviewFailedError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.FormMain.PreviewFailedError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
break;
}
@@ -2212,8 +2216,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
LastException = ex;
- MessageBox.Show(this, string.Format(Strings.FormMain.XmlEditorError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.FormMain.XmlEditorError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
@@ -2262,8 +2267,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
LastException = ex;
- MessageBox.Show(this, string.Format(Strings.FormMain.XmlEditorError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.FormMain.XmlEditorError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
@@ -2298,8 +2304,9 @@
}
catch(Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
LastException = ex;
- MessageBox.Show(this, string.Format(Strings.FormMain.OpenResourceError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.FormMain.OpenResourceError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -2338,8 +2345,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
LastException = ex;
- MessageBox.Show(this, string.Format(Strings.FormMain.SaveResourceError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.FormMain.SaveResourceError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
@@ -2533,14 +2541,14 @@
if (MaestroAPI.PackageBuilder.PackageProgress.UploadPackage(this, m_connection) == DialogResult.OK)
RebuildDocumentTree();
}
- catch(Exception ex)
+ catch (Exception ex)
{
LastException = ex;
if (ex is System.Reflection.TargetInvocationException && ex.InnerException != null)
ex = ex.InnerException;
-
- MessageBox.Show(this, string.Format(Strings.FormMain.PackageRestoreError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.FormMain.PackageRestoreError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -2902,6 +2910,7 @@
catch (Exception ex)
{
this.LastException = ex;
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
MessageBox.Show(this, string.Format(Strings.FormMain.ValidationError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
@@ -2944,7 +2953,8 @@
}
catch (Exception ex)
{
- issues.Add(new KeyValuePair<string, ResourceValidators.ValidationIssue[]>(s, new ResourceValidators.ValidationIssue[] { new OSGeo.MapGuide.Maestro.ResourceValidators.ValidationIssue(s, OSGeo.MapGuide.Maestro.ResourceValidators.ValidationStatus.Error, string.Format(Strings.FormMain.ValidationResourceLoadFailed, ex.Message)) }));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new KeyValuePair<string, ResourceValidators.ValidationIssue[]>(s, new ResourceValidators.ValidationIssue[] { new OSGeo.MapGuide.Maestro.ResourceValidators.ValidationIssue(s, OSGeo.MapGuide.Maestro.ResourceValidators.ValidationStatus.Error, string.Format(Strings.FormMain.ValidationResourceLoadFailed, msg)) }));
}
i++;
worker.ReportProgress((int)((i / (double)documents.Count) * 100), s);
@@ -3000,8 +3010,9 @@
{ }
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
this.LastException = ex;
- MessageBox.Show(this, string.Format(Strings.FormMain.ValidationError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.FormMain.ValidationError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Modified: trunk/Tools/Maestro/Maestro/FusionEditor/ApplicationDefinitionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/FusionEditor/ApplicationDefinitionEditor.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/FusionEditor/ApplicationDefinitionEditor.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -1186,7 +1186,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, String.Format(Strings.ApplicationDefinitionEditor.BrowserLaunchError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, String.Format(Strings.ApplicationDefinitionEditor.BrowserLaunchError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Modified: trunk/Tools/Maestro/Maestro/LengthyOperation.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/LengthyOperation.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/LengthyOperation.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -22,6 +22,7 @@
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro
{
@@ -317,7 +318,8 @@
catch (System.Reflection.TargetInvocationException tex)
{
Exception ex = tex.InnerException;
- switch (MessageBox.Show(string.Format(Strings.LengthyOperation.ErrorOccuredRetryQuestion, ex.Message), Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1))
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ switch (MessageBox.Show(string.Format(Strings.LengthyOperation.ErrorOccuredRetryQuestion, msg), Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1))
{
case DialogResult.No:
throw;
@@ -331,7 +333,9 @@
{
if (ex.GetType() == typeof(System.Reflection.TargetInvocationException))
ex = ex.InnerException;
- MessageBox.Show(string.Format(Strings.LengthyOperation.OperationFailedError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(string.Format(Strings.LengthyOperation.OperationFailedError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
this.Invoke(new System.Threading.ThreadStart(CloseDialog));
Modified: trunk/Tools/Maestro/Maestro/LoginForm/FormLogin.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/LoginForm/FormLogin.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/LoginForm/FormLogin.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -145,6 +145,11 @@
{
try
{
+ throw new Exception("Outer Message",
+ new Exception("Inner Message 1",
+ new Exception("Inner Message 2",
+ new Exception("Inner Message 3"))));
+
PreferedSite ps = null;
if (_selectedIndex == 0) //HTTP
@@ -210,15 +215,13 @@
_conn.AutoRestartSession = true;
-
-
this.DialogResult = DialogResult.OK;
this.Close();
-
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.FormLogin.ConnectionFailedError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.FormLogin.ConnectionFailedError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
Modified: trunk/Tools/Maestro/Maestro/MaestroEditorInterface/IValidator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/MaestroEditorInterface/IValidator.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/MaestroEditorInterface/IValidator.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -20,6 +20,7 @@
using System;
using System.Collections.Generic;
using System.Text;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceValidators
{
@@ -128,7 +129,8 @@
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(item, ValidationStatus.Error, "Failed in validator: " + ex.Message));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(item, ValidationStatus.Error, "Failed in validator: " + msg));
}
}
Modified: trunk/Tools/Maestro/Maestro/PackageManager/AddResourceEntry.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/PackageManager/AddResourceEntry.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/PackageManager/AddResourceEntry.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.PackageManager
{
@@ -78,7 +79,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.AddResourceEntry.FilenameValidationError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.AddResourceEntry.FilenameValidationError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Modified: trunk/Tools/Maestro/Maestro/PackageManager/CreatePackage.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/PackageManager/CreatePackage.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/PackageManager/CreatePackage.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -93,7 +93,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.CreatePackage.ValidateOutputfileError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.CreatePackage.ValidateOutputfileError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
@@ -113,7 +114,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.CreatePackage.InvalidRestorePathError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.CreatePackage.InvalidRestorePathError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
@@ -136,8 +138,8 @@
}
catch (Exception ex)
{
- string s = ex.Message;
- System.Windows.Forms.MessageBox.Show(string.Format(Strings.CreatePackage.PackageCreationFailedError, ex.Message), System.Windows.Forms.Application.ProductName, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ System.Windows.Forms.MessageBox.Show(string.Format(Strings.CreatePackage.PackageCreationFailedError, msg), System.Windows.Forms.Application.ProductName, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
return;
}
this.Close();
Modified: trunk/Tools/Maestro/Maestro/PackageManager/PackageEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/PackageManager/PackageEditor.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/PackageManager/PackageEditor.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -95,7 +95,8 @@
if (ex is System.Reflection.TargetInvocationException && ex.InnerException != null)
ex = ex.InnerException;
- MessageBox.Show(this, string.Format(Strings.PackageEditor.PackageReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.PackageEditor.PackageReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
this.DialogResult = DialogResult.Cancel;
this.Close();
return;
@@ -239,6 +240,7 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
MessageBox.Show(this, string.Format(Strings.PackageEditor.FileCopyError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
@@ -466,7 +468,9 @@
{
if (ex is System.Reflection.TargetInvocationException && ex.InnerException != null)
ex = ex.InnerException;
- MessageBox.Show(this, string.Format(Strings.PackageEditor.PackageBuildError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.PackageEditor.PackageBuildError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
finally
Modified: trunk/Tools/Maestro/Maestro/Profiling.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/Profiling.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/Profiling.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -140,7 +140,8 @@
}
catch (Exception ex)
{
- backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.LayerDefinitionProfilingError, resourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.LayerDefinitionProfilingError, resourceId, msg)));
}
}
@@ -247,15 +248,19 @@
}
catch (Exception ex)
{
- backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.LayerDefinitionProfilingError, ml.ResourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.LayerDefinitionProfilingError, ml.ResourceId, msg)));
}
}
if (mdef.BaseMapDefinition != null && mdef.BaseMapDefinition.BaseMapLayerGroup != null)
{
foreach (BaseMapLayerGroupCommonType g in mdef.BaseMapDefinition.BaseMapLayerGroup)
+ {
if (g.BaseMapLayer != null)
+ {
foreach (BaseMapLayerType ml in g.BaseMapLayer)
+ {
try
{
if (backgroundWorker.CancellationPending)
@@ -266,8 +271,12 @@
}
catch (Exception ex)
{
- backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.LayerDefinitionProfilingError, ml.ResourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.LayerDefinitionProfilingError, ml.ResourceId, msg)));
}
+ }
+ }
+ }
}
}
@@ -285,7 +294,8 @@
}
catch (Exception ex)
{
- backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.RuntimeMapProfilingError, resourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.RuntimeMapProfilingError, resourceId, msg)));
}
string tmp2 = new ResourceIdentifier(Guid.NewGuid().ToString(), ResourceTypes.RuntimeMap, m_connection.SessionID);
@@ -309,7 +319,8 @@
}
catch (Exception ex)
{
- backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.MapRenderingError, resourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ backgroundWorker.ReportProgress(0, (string.Format(Strings.Profiling.MapRenderingError, resourceId, msg)));
}
finally
{
Modified: trunk/Tools/Maestro/Maestro/Program.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/Program.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/Program.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -19,6 +19,7 @@
#endregion
using System;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro
{
Modified: trunk/Tools/Maestro/Maestro/ResourceEditorMap.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditorMap.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditorMap.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -19,6 +19,7 @@
#endregion
using System;
using System.Collections;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro
{
@@ -189,7 +190,8 @@
}
catch (Exception ex)
{
- throw new Exception(string.Format(Strings.ResourceEditorMap.AssemblyLoadError, path, ex.Message), ex);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ throw new Exception(string.Format(Strings.ResourceEditorMap.AssemblyLoadError, path, msg), ex);
}
img = System.Drawing.Image.FromStream(asm.GetManifestResourceStream(e.ImageResourceName));
}
@@ -212,7 +214,8 @@
}
catch (Exception ex)
{
- throw new Exception(string.Format(Strings.ResourceEditorMap.AssemblyLoadError, path, ex.Message), ex);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ throw new Exception(string.Format(Strings.ResourceEditorMap.AssemblyLoadError, path, msg), ex);
}
System.Type editorType = editorAsm.GetType(e.ResourceEditorClass, true, false);
@@ -228,7 +231,8 @@
}
catch (Exception ex)
{
- throw new Exception(string.Format(Strings.ResourceEditorMap.AssemblyLoadError, path, ex.Message), ex);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ throw new Exception(string.Format(Strings.ResourceEditorMap.AssemblyLoadError, path, msg), ex);
}
System.Type instanceType = instanceAsm.GetType(e.ResourceInstanceClass, true, false);
@@ -254,7 +258,8 @@
}
catch (Exception ex)
{
- throw new Exception(string.Format(Strings.ResourceEditorMap.ResourceEditorLoadError, ex.Message), ex);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ throw new Exception(string.Format(Strings.ResourceEditorMap.ResourceEditorLoadError, msg), ex);
}
finally
{
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/CoordinateSystemOverride.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/CoordinateSystemOverride.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/CoordinateSystemOverride.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -469,8 +469,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.CoordinateSystemOverride.CoordinateSystemLoadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.CoordinateSystemOverride.CoordinateSystemLoadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -515,8 +516,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.CoordinateSystemOverride.CoordinateSystemLoadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.CoordinateSystemOverride.CoordinateSystemLoadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -599,8 +601,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.CoordinateSystemOverride.CoordinateSystemLoadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.CoordinateSystemOverride.CoordinateSystemLoadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditorBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditorBase.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditorBase.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -25,6 +25,7 @@
using System.Windows.Forms;
using OSGeo.MapGuide.Maestro;
using OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourcePreview;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors
{
@@ -235,7 +236,8 @@
}
catch (Exception ex)
{
- throw new Exception(string.Format(Strings.FeatureSourceEditorBase.AssemblyLoadError, pv.Provider, System.IO.Path.GetFullPath(pv.AssemblyPath), ex.Message), ex);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ throw new Exception(string.Format(Strings.FeatureSourceEditorBase.AssemblyLoadError, pv.Provider, System.IO.Path.GetFullPath(pv.AssemblyPath), msg), ex);
}
Type t = asm.GetType(pv.Control);
if (t == null)
@@ -516,7 +518,7 @@
}
catch(Exception ex)
{
- TestConnectionResult.Text = ex.Message;
+ TestConnectionResult.Text = NestedExceptionMessageProcessor.GetFullMessage(ex);
}
}
@@ -538,8 +540,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(string.Format(Strings.FeatureSourceEditorBase.ResourceSaveError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(string.Format(Strings.FeatureSourceEditorBase.ResourceSaveError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
@@ -589,8 +592,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.FeatureSourceEditorBase.XmlUpdateError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.FeatureSourceEditorBase.XmlUpdateError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/Gdal/Composite.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/Gdal/Composite.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/Gdal/Composite.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Drawing;
using System.Data;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.Gdal
{
@@ -407,8 +408,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.Composite.FileLoadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.Composite.FileLoadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/FeatureSourceEditorODBC.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/FeatureSourceEditorODBC.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/FeatureSourceEditorODBC.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -25,6 +25,7 @@
using System.Windows.Forms;
using System.Collections.Specialized;
using OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC
{
@@ -202,8 +203,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.CoordinateSystemError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.CoordinateSystemError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -451,8 +453,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.CoordinateSystemError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.CoordinateSystemError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
@@ -547,8 +550,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.SchemaRefreshError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.SchemaRefreshError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -853,8 +857,9 @@
}
catch(Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.ConfigurationReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.ConfigurationReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
@@ -878,8 +883,9 @@
}
catch(Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.DatasourceLayoutReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC.Strings.FeatureSourceEditorODBC.DatasourceLayoutReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourcePreview/SqlPreviewCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourcePreview/SqlPreviewCtrl.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourcePreview/SqlPreviewCtrl.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -48,7 +48,7 @@
}
catch (Exception ex)
{
- MessageBox.Show(ex.Message);
+ MessageBox.Show(NestedExceptionMessageProcessor.GetFullMessage(ex));
}
if (reader != null)
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditor.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditor.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -23,6 +23,7 @@
using System.Drawing;
using System.Data;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors
{
@@ -122,8 +123,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.LayerEditor.SchemaReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.LayerEditor.SchemaReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -601,8 +603,9 @@
}
catch(Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.LayerEditor.MapPreviewError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.LayerEditor.MapPreviewError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return true;
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditorControls/ScaleControls/ConditionListButtons.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditorControls/ScaleControls/ConditionListButtons.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditorControls/ScaleControls/ConditionListButtons.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -152,8 +152,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_owner.Editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.Strings.Common.GenericError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.Strings.Common.GenericError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditorControls/VectorLayer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditorControls/VectorLayer.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/LayerEditorControls/VectorLayer.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -801,7 +801,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.VectorLayer.FeatureSourceReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.VectorLayer.FeatureSourceReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
return null;
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutControls/InvokeURL.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutControls/InvokeURL.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutControls/InvokeURL.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -23,6 +23,7 @@
using System.Drawing;
using System.Data;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors.LayoutControls
{
@@ -372,8 +373,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.InvokeURL.LayerListReadError, mapname, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.InvokeURL.LayerListReadError, mapname, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutControls/SearchCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutControls/SearchCommand.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutControls/SearchCommand.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Data;
using System.Windows.Forms;
using System.Collections.Generic;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors.LayoutControls
{
@@ -439,8 +440,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.Strings.Common.GenericError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ MessageBox.Show(this, string.Format(OSGeo.MapGuide.Maestro.ResourceEditors.Strings.Common.GenericError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutEditor.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/LayoutEditor.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -23,6 +23,7 @@
using System.Drawing;
using System.Data;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors
{
@@ -1506,7 +1507,7 @@
if (System.IO.Directory.Exists(path))
foreach(string s in System.IO.Directory.GetFiles(path, "*.gif"))
{
- LoadedImageList.Images.Add(Image.FromFile(s));
+ LoadedImageList.Images.Add(System.Drawing.Image.FromFile(s));
LoadedImages.Add("../stdicons/" + System.IO.Path.GetFileName(s), LoadedImageList.Images.Count - 1);
}
}
@@ -2003,8 +2004,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, String.Format(Strings.LayoutEditor.BrowserLaunchError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, String.Format(Strings.LayoutEditor.BrowserLaunchError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Data;
using System.Windows.Forms;
using System.Collections.Generic;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors
{
@@ -1247,8 +1248,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.MapEditor.LayerProjectionReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.MapEditor.LayerProjectionReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
SelectCoordinateSystem dlg = new SelectCoordinateSystem(m_editor.CurrentConnection);
@@ -1853,8 +1855,9 @@
}
catch(Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.MapEditor.MapPreviewError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.MapEditor.MapPreviewError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return true;
@@ -2153,8 +2156,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.MapEditor.LayerProjectionReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.MapEditor.LayerProjectionReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
txtLowerX.Text = env.MinX.ToString(System.Globalization.CultureInfo.CurrentUICulture);
@@ -2164,8 +2168,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.MapEditor.LayerExtentReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.MapEditor.LayerExtentReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/ResourceDataEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/ResourceDataEditor.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/ResourceDataEditor.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -25,6 +25,7 @@
using System.Windows.Forms;
using System.Collections.Specialized;
using System.Collections.Generic;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors
{
@@ -400,6 +401,7 @@
{
bool retry = true;
while (retry)
+ {
try
{
string filename = System.IO.Path.GetFileName(s);
@@ -449,13 +451,14 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
if (worker.CancellationPending)
{
args.Cancel = true;
return res;
}
- switch (MessageBox.Show(owner, string.Format(Strings.ResourceDataEditor.UploadFailedQuestion, s, ex.Message), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
+ switch (MessageBox.Show(owner, string.Format(Strings.ResourceDataEditor.UploadFailedQuestion, s, msg), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
{
case DialogResult.Abort:
return res;
@@ -464,6 +467,7 @@
continue;
}
}
+ }
i++;
worker.ReportProgress((int)((i / (double)actualFiles.Count) * 100));
}
@@ -500,7 +504,8 @@
}
catch (Exception ex)
{
- switch (MessageBox.Show(owner, string.Format(Strings.ResourceDataEditor.DeleteFailedQuestion, resourcename, ex.Message), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ switch (MessageBox.Show(owner, string.Format(Strings.ResourceDataEditor.DeleteFailedQuestion, resourcename, msg), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
{
case DialogResult.Abort:
return res;
@@ -560,7 +565,8 @@
}
catch(Exception ex)
{
- switch (MessageBox.Show(owner, string.Format(Strings.ResourceDataEditor.DownloadFailedQuestion, items[0], ex.Message), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ switch (MessageBox.Show(owner, string.Format(Strings.ResourceDataEditor.DownloadFailedQuestion, items[0], msg), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
{
case DialogResult.Abort:
return res;
@@ -607,7 +613,8 @@
}
catch(Exception ex)
{
- switch (MessageBox.Show(owner, string.Format(Strings.ResourceDataEditor.DownloadFailedQuestion, item, ex.Message), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ switch (MessageBox.Show(owner, string.Format(Strings.ResourceDataEditor.DownloadFailedQuestion, item, msg), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
{
case DialogResult.Abort:
return res;
@@ -673,8 +680,9 @@
}
catch(Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- switch (MessageBox.Show(this, string.Format(Strings.ResourceDataEditor.DownloadFailedQuestion, i.Text, ex.Message), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
+ switch (MessageBox.Show(this, string.Format(Strings.ResourceDataEditor.DownloadFailedQuestion, i.Text, msg), Application.ProductName, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
{
case DialogResult.Abort:
RefreshFileList();
@@ -782,8 +790,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.ResourceDataEditor.FailedToCreateCopyError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.ResourceDataEditor.FailedToCreateCopyError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
@@ -848,8 +857,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.ResourceDataEditor.UpdateXmlDataError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.ResourceDataEditor.UpdateXmlDataError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/ThemeCreator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/ThemeCreator.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/ThemeCreator.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceEditors
{
@@ -539,7 +540,7 @@
}
}
- Image prevImage = PreviewPicture.Image;
+ System.Drawing.Image prevImage = PreviewPicture.Image;
PreviewPicture.Image = bmp;
if (prevImage != null)
prevImage.Dispose();
@@ -727,8 +728,9 @@
}
catch(Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
m_editor.SetLastException(ex);
- MessageBox.Show(this, string.Format(Strings.Common.GenericError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.Common.GenericError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceProperties.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceProperties.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceProperties.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -611,7 +611,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.ResourceProperties.SaveError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.ResourceProperties.SaveError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
@@ -776,8 +777,9 @@
}
catch (Exception ex)
{
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
warnedEPSG = true;
- MessageBox.Show(this, string.Format(Strings.ResourceProperties.BoundsDecodeError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, string.Format(Strings.ResourceProperties.BoundsDecodeError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
System.Globalization.CultureInfo ic = System.Globalization.CultureInfo.InvariantCulture;
@@ -803,7 +805,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.ResourceProperties.WMSBoundsReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.ResourceProperties.WMSBoundsReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -841,7 +844,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.ResourceProperties.WFSBoundsReadError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.ResourceProperties.WFSBoundsReadError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceValidators/ApplicationDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceValidators/ApplicationDefinitionValidator.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceValidators/ApplicationDefinitionValidator.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -72,7 +72,8 @@
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(fusionApp, ValidationStatus.Error, string.Format(Strings.ApplicationDefinitionValidator.MapValidationError, mapGroup.id, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(fusionApp, ValidationStatus.Error, string.Format(Strings.ApplicationDefinitionValidator.MapValidationError, mapGroup.id, msg)));
}
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceValidators/FeatureSourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceValidators/FeatureSourceValidator.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceValidators/FeatureSourceValidator.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -20,6 +20,7 @@
using System;
using System.Collections.Generic;
using OSGeo.MapGuide.Maestro;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceValidators
{
@@ -56,7 +57,8 @@
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(feature, ValidationStatus.Error, string.Format(Strings.FeatureSourceValidator.SpatialContextReadError, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Error, string.Format(Strings.FeatureSourceValidator.SpatialContextReadError, msg)));
}
List<string> classes = new List<string>();
@@ -71,11 +73,13 @@
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(feature, ValidationStatus.Error, string.Format(Strings.FeatureSourceValidator.SchemaReadError, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Error, string.Format(Strings.FeatureSourceValidator.SchemaReadError, msg)));
}
foreach (string cl in classes)
+ {
try
{
string[] ids = feature.GetIdentityProperties(cl);
@@ -84,8 +88,10 @@
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(feature, ValidationStatus.Error, string.Format(Strings.FeatureSourceValidator.PrimaryKeyReadError, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Error, string.Format(Strings.FeatureSourceValidator.PrimaryKeyReadError, msg)));
}
+ }
return issues.ToArray();
}
Modified: trunk/Tools/Maestro/Maestro/ResourceValidators/MapDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceValidators/MapDefinitionValidator.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceValidators/MapDefinitionValidator.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -20,6 +20,7 @@
using System;
using System.Collections.Generic;
using System.Text;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro.ResourceValidators
{
@@ -144,19 +145,22 @@
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(ldef, ValidationStatus.Error, string.Format(Strings.MapDefinitionValidator.ResourceReadError, fs.ResourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(ldef, ValidationStatus.Error, string.Format(Strings.MapDefinitionValidator.ResourceReadError, fs.ResourceId, msg)));
}
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, string.Format(Strings.MapDefinitionValidator.FeatureSourceReadError, l.ResourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, string.Format(Strings.MapDefinitionValidator.FeatureSourceReadError, l.ResourceId, msg)));
}
}
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, string.Format(Strings.MapDefinitionValidator.LayerReadError, l.ResourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, string.Format(Strings.MapDefinitionValidator.LayerReadError, l.ResourceId, msg)));
}
}
}
Modified: trunk/Tools/Maestro/Maestro/ResourceValidators/WebLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceValidators/WebLayoutValidator.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ResourceValidators/WebLayoutValidator.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -58,7 +58,8 @@
}
catch (Exception ex)
{
- issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Strings.WebLayoutValidator.MapValidationError, layout.Map.ResourceId, ex.Message)));
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Strings.WebLayoutValidator.MapValidationError, layout.Map.ResourceId, msg)));
}
}
}
Modified: trunk/Tools/Maestro/Maestro/ValidationResults.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ValidationResults.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/Maestro/ValidationResults.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.Maestro
{
@@ -104,7 +105,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.ValidationResults.ValidationFailedError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.ValidationResults.ValidationFailedError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
Modified: trunk/Tools/Maestro/MaestroAPI/HttpServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/HttpServerConnection.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/MaestroAPI/HttpServerConnection.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -117,7 +117,8 @@
}
catch (Exception ex)
{
- throw new Exception("Failed to connect, please check network connection and login information.\nExtended error info: " + ex.Message, ex);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ throw new Exception("Failed to connect, please check network connection and login information.\nExtended error info: " + msg, ex);
}
if (!allowUntestedVersion)
@@ -251,7 +252,7 @@
}
catch (Exception ex)
{
- result = ex.Message;
+ result = NestedExceptionMessageProcessor.GetFullMessage(ex);
}
return result;
@@ -273,27 +274,29 @@
}
catch (WebException wex)
{
- if (wex.Response != null)
- try
- {
- string result = "";
- using(System.IO.MemoryStream ms = new System.IO.MemoryStream())
- {
- Utility.CopyStream(wex.Response.GetResponseStream(), ms);
- result = System.Text.Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length);
- }
+ if (wex.Response != null)
+ {
+ try
+ {
+ string result = "";
+ using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
+ {
+ Utility.CopyStream(wex.Response.GetResponseStream(), ms);
+ result = System.Text.Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length);
+ }
- if (result.ToLower().IndexOf("<body>") > 0)
- result = result.Substring(result.ToLower().IndexOf("<body>") + 6);
+ if (result.ToLower().IndexOf("<body>") > 0)
+ result = result.Substring(result.ToLower().IndexOf("<body>") + 6);
- if (result.ToLower().IndexOf("</body>") > 0)
- result = result.Substring(0, result.ToLower().IndexOf("</body>"));
+ if (result.ToLower().IndexOf("</body>") > 0)
+ result = result.Substring(0, result.ToLower().IndexOf("</body>"));
- return result;
- }
- catch
- {
- }
+ return result;
+ }
+ catch
+ {
+ }
+ }
if (wex.InnerException == null)
return wex.Message;
@@ -302,7 +305,7 @@
}
catch (Exception ex)
{
- return ex.Message;
+ return NestedExceptionMessageProcessor.GetFullMessage(ex);
}
return string.Empty;
Modified: trunk/Tools/Maestro/MaestroAPI/MgFeatureSetReader.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/MgFeatureSetReader.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/MaestroAPI/MgFeatureSetReader.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -149,7 +149,7 @@
{
//Just like the XmlFeatureSetReader, invalid geometry can bite us again
m_nulls[ordinal] = true;
- m_items[ordinal] = ex.Message;
+ m_items[ordinal] = NestedExceptionMessageProcessor.GetFullMessage(ex);
ex.Dispose();
}
}
Added: trunk/Tools/Maestro/MaestroAPI/NestedExceptionMessageProcessor.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/NestedExceptionMessageProcessor.cs (rev 0)
+++ trunk/Tools/Maestro/MaestroAPI/NestedExceptionMessageProcessor.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -0,0 +1,52 @@
+#region Disclaimer / License
+// Copyright (C) 2010, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OSGeo.MapGuide.MaestroAPI
+{
+ /// <summary>
+ /// Helper class to process exception messages for exceptions that may contain one or more nested inner exceptions
+ /// </summary>
+ public static class NestedExceptionMessageProcessor
+ {
+ /// <summary>
+ /// Returns a formatted string containing the main exception message and all messages within the <see cref="InnerException"/> properties
+ /// </summary>
+ /// <param name="ex"></param>
+ /// <returns></returns>
+ public static string GetFullMessage(Exception error)
+ {
+ if (error == null)
+ return string.Empty;
+
+ Exception ex = error;
+ string innerPrefix = Environment.NewLine + "\t";
+ StringBuilder sb = new StringBuilder(ex.Message);
+ while (ex.InnerException != null)
+ {
+ sb.Append(innerPrefix + ex.Message);
+ ex = ex.InnerException;
+ }
+ return sb.ToString();
+ }
+ }
+}
Modified: trunk/Tools/Maestro/MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj 2010-06-04 00:06:46 UTC (rev 4933)
@@ -1,7 +1,7 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<ProjectType>Local</ProjectType>
- <ProductVersion>9.0.21022</ProductVersion>
+ <ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{290B027E-3649-4A60-A9BF-0544831435E2}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -295,6 +295,7 @@
<Compile Include="LocalNativeCoordinateSystemCatalog.cs" />
<Compile Include="LocalNativeCoordinateSystemCategory.cs" />
<Compile Include="MgFeatureSetReader.cs" />
+ <Compile Include="NestedExceptionMessageProcessor.cs" />
<Compile Include="RequestBuilder.cs">
<SubType>Code</SubType>
</Compile>
Modified: trunk/Tools/Maestro/MgCooker/SetupRun.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/SetupRun.cs 2010-05-27 22:44:10 UTC (rev 4932)
+++ trunk/Tools/Maestro/MgCooker/SetupRun.cs 2010-06-04 00:06:46 UTC (rev 4933)
@@ -24,6 +24,7 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.MgCooker
{
@@ -175,7 +176,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.SetupRun.ConnectionError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.SetupRun.ConnectionError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
@@ -187,7 +189,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.SetupRun.ConnectionError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.SetupRun.ConnectionError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
@@ -229,7 +232,8 @@
}
catch (Exception ex)
{
- MessageBox.Show(this, string.Format(Strings.SetupRun.InternalError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
+ MessageBox.Show(this, string.Format(Strings.SetupRun.InternalError, msg), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
More information about the mapguide-commits
mailing list