Index: Oem/fusionMG/templates/mapguide/aqua/index.html
===================================================================
--- Oem/fusionMG/templates/mapguide/aqua/index.html	(revision 4040)
+++ Oem/fusionMG/templates/mapguide/aqua/index.html	(working copy)
@@ -101,12 +101,31 @@
     Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, fusionInitialized);
     Fusion.registerForEvent(Fusion.Event.FUSION_ERROR, fusionError);
     Fusion.initialize();
+}
+
+var fusionError = function(eventId, error) {
+    var errorMessage = error.toString();
+    var readableMessage = '';
+    var xmlInvalid = 'xml2json: invalid XML document: ';
+    var indexXMLInvalid = errorMessage.indexOf(xmlInvalid);
+    if (indexXMLInvalid != -1) {
+        var indexStart = indexXMLInvalid + xmlInvalid.length;
+        if (indexStart < errorMessage.length) {
+            var indexEnd = errorMessage.indexOf(' :', indexStart);
+            if (indexEnd != -1) {
+                readableMessage = errorMessage.substring(indexStart, indexEnd);
+            }
+        }
+    }
+    if (readableMessage != '') {
+        alert('Fusion Error: \n' + readableMessage);
+    }
+    else {
+        alert('Fusion Error: \n' + errorMessage);
+    }
+    console.log('Fusion Error: \n' + errorMessage);
 }
 
-var fusionError = function(eventId, error) {
-    //console.log('Fusion Error: \n' + error.toString());
-}
-
 var fusionInitialized = function() {
 
     $('AppContainer').resize({forceResize: true});
Index: Oem/fusionMG/templates/mapguide/limegold/index.html
===================================================================
--- Oem/fusionMG/templates/mapguide/limegold/index.html	(revision 4040)
+++ Oem/fusionMG/templates/mapguide/limegold/index.html	(working copy)
@@ -92,8 +92,26 @@
 }
 
 var fusionError = function(eventId, error) {
-    alert('Fusion Error: \n' + error.toString());
-    //console.log('Fusion Error: \n' + error.toString());
+    var errorMessage = error.toString();
+    var readableMessage = '';
+    var xmlInvalid = 'xml2json: invalid XML document: ';
+    var indexXMLInvalid = errorMessage.indexOf(xmlInvalid);
+    if (indexXMLInvalid != -1) {
+        var indexStart = indexXMLInvalid + xmlInvalid.length;
+        if (indexStart < errorMessage.length) {
+            var indexEnd = errorMessage.indexOf(' :', indexStart);
+            if (indexEnd != -1) {
+                readableMessage = errorMessage.substring(indexStart, indexEnd);
+            }
+        }
+    }
+    if (readableMessage != '') {
+        alert('Fusion Error: \n' + readableMessage);
+    }
+    else {
+        alert('Fusion Error: \n' + errorMessage);
+    }
+    console.log('Fusion Error: \n' + errorMessage);
 }
 
 var fusionInitialized = function() {
Index: Oem/fusionMG/templates/mapguide/maroon/index.html
===================================================================
--- Oem/fusionMG/templates/mapguide/maroon/index.html	(revision 4040)
+++ Oem/fusionMG/templates/mapguide/maroon/index.html	(working copy)
@@ -115,8 +115,26 @@
 }
 
 var fusionError = function(eventId, error) {
-    alert('Fusion Error: \n' + error.toString());
-    //console.log('Fusion Error: \n' + error.toString());
+    var errorMessage = error.toString();
+    var readableMessage = '';
+    var xmlInvalid = 'xml2json: invalid XML document: ';
+    var indexXMLInvalid = errorMessage.indexOf(xmlInvalid);
+    if (indexXMLInvalid != -1) {
+        var indexStart = indexXMLInvalid + xmlInvalid.length;
+        if (indexStart < errorMessage.length) {
+            var indexEnd = errorMessage.indexOf(' :', indexStart);
+            if (indexEnd != -1) {
+                readableMessage = errorMessage.substring(indexStart, indexEnd);
+            }
+        }
+    }
+    if (readableMessage != '') {
+        alert('Fusion Error: \n' + readableMessage);
+    }
+    else {
+        alert('Fusion Error: \n' + errorMessage);
+    }
+    console.log('Fusion Error: \n' + errorMessage);
 }
 
 var fusionInitialized = function() {
Index: Oem/fusionMG/templates/mapguide/preview/index.html
===================================================================
--- Oem/fusionMG/templates/mapguide/preview/index.html	(revision 4040)
+++ Oem/fusionMG/templates/mapguide/preview/index.html	(working copy)
@@ -90,8 +90,28 @@
      Fusion.initialize();
 }
 
-function fusionError(eventId, error) {
-     console.log('Fusion Error: \n' + error.toString()); }
+var fusionError = function(eventId, error) {
+    var errorMessage = error.toString();
+    var readableMessage = '';
+    var xmlInvalid = 'xml2json: invalid XML document: ';
+    var indexXMLInvalid = errorMessage.indexOf(xmlInvalid);
+    if (indexXMLInvalid != -1) {
+        var indexStart = indexXMLInvalid + xmlInvalid.length;
+        if (indexStart < errorMessage.length) {
+            var indexEnd = errorMessage.indexOf(' :', indexStart);
+            if (indexEnd != -1) {
+                readableMessage = errorMessage.substring(indexStart, indexEnd);
+            }
+        }
+    }
+    if (readableMessage != '') {
+        alert('Fusion Error: \n' + readableMessage);
+    }
+    else {
+        alert('Fusion Error: \n' + errorMessage);
+    }
+    console.log('Fusion Error: \n' + errorMessage);
+}
 
 function fusionInitialized() {
      $('thePage').resize({forceResize: true});
Index: Oem/fusionMG/templates/mapguide/slate/index.html
===================================================================
--- Oem/fusionMG/templates/mapguide/slate/index.html	(revision 4040)
+++ Oem/fusionMG/templates/mapguide/slate/index.html	(working copy)
@@ -96,8 +96,26 @@
 }
 
 var fusionError = function(eventId, error) {
-    alert('Fusion Error: \n' + error.toString());
-    //console.log('Fusion Error: \n' + error.toString());
+    var errorMessage = error.toString();
+    var readableMessage = '';
+    var xmlInvalid = 'xml2json: invalid XML document: ';
+    var indexXMLInvalid = errorMessage.indexOf(xmlInvalid);
+    if (indexXMLInvalid != -1) {
+        var indexStart = indexXMLInvalid + xmlInvalid.length;
+        if (indexStart < errorMessage.length) {
+            var indexEnd = errorMessage.indexOf(' :', indexStart);
+            if (indexEnd != -1) {
+                readableMessage = errorMessage.substring(indexStart, indexEnd);
+            }
+        }
+    }
+    if (readableMessage != '') {
+        alert('Fusion Error: \n' + readableMessage);
+    }
+    else {
+        alert('Fusion Error: \n' + errorMessage);
+    }
+    console.log('Fusion Error: \n' + errorMessage);
 }
 
 var fusionInitialized = function() {
Index: Oem/fusionMG/templates/mapguide/turquoiseyellow/index.html
===================================================================
--- Oem/fusionMG/templates/mapguide/turquoiseyellow/index.html	(revision 4040)
+++ Oem/fusionMG/templates/mapguide/turquoiseyellow/index.html	(working copy)
@@ -80,8 +80,26 @@
 }
 
 var fusionError = function(eventId, error) {
-    alert('Fusion Error: \n' + error.toString());
-    //console.log('Fusion Error: \n' + error.toString());
+    var errorMessage = error.toString();
+    var readableMessage = '';
+    var xmlInvalid = 'xml2json: invalid XML document: ';
+    var indexXMLInvalid = errorMessage.indexOf(xmlInvalid);
+    if (indexXMLInvalid != -1) {
+        var indexStart = indexXMLInvalid + xmlInvalid.length;
+        if (indexStart < errorMessage.length) {
+            var indexEnd = errorMessage.indexOf(' :', indexStart);
+            if (indexEnd != -1) {
+                readableMessage = errorMessage.substring(indexStart, indexEnd);
+            }
+        }
+    }
+    if (readableMessage != '') {
+        alert('Fusion Error: \n' + readableMessage);
+    }
+    else {
+        alert('Fusion Error: \n' + errorMessage);
+    }
+    console.log('Fusion Error: \n' + errorMessage);
 }
 
 var fusionInitialized = function() {
Index: Web/src/ApacheAgent/ApacheResponseHandler.cpp
===================================================================
--- Web/src/ApacheAgent/ApacheResponseHandler.cpp	(revision 4040)
+++ Web/src/ApacheAgent/ApacheResponseHandler.cpp	(working copy)
@@ -56,7 +56,7 @@
             //TODO: Use a resource for the HTML error message
             STRING shortError = result->GetErrorMessage();
             STRING longError = result->GetDetailedErrorMessage();
-            sprintf(tempHeader, "%d %s", status, MG_WCHAR_TO_CHAR(statusMessage));
+            sprintf(tempHeader, "%d %s", status, MG_WCHAR_TO_CHAR(shortError));
             m_r->status = status;
             m_r->status_line = tempHeader;
             apr_table_set(m_r->headers_out, MapAgentStrings::StatusKey, tempHeader);
@@ -180,7 +180,7 @@
 
     char tempHeader[4096];
 
-    sprintf(tempHeader, "%d %s", 559, MG_WCHAR_TO_CHAR(statusMessage));
+    sprintf(tempHeader, "%d %s", 559, MG_WCHAR_TO_CHAR(shortError));
     m_r->status = 559;
     m_r->status_line = tempHeader;
     apr_table_set(m_r->headers_out, MapAgentStrings::StatusKey, tempHeader);
Index: Web/src/CgiAgent/CgiResponseHandler.cpp
===================================================================
--- Web/src/CgiAgent/CgiResponseHandler.cpp	(revision 4040)
+++ Web/src/CgiAgent/CgiResponseHandler.cpp	(working copy)
@@ -62,7 +62,7 @@
             //TODO: Use a resource for the HTML error message
             STRING shortError = result->GetErrorMessage();
             STRING longError = result->GetDetailedErrorMessage();
-            printf(MapAgentStrings::StatusHeader, status, MG_WCHAR_TO_CHAR(statusMessage));
+            printf(MapAgentStrings::StatusHeader, status, MG_WCHAR_TO_CHAR(shortError));
             printf(MapAgentStrings::ContentTypeHeader, MapAgentStrings::TextHtml, "");
             printf("\r\n"
                 "<html>\n<head>\n"
@@ -175,7 +175,7 @@
     STRING statusMessage = e->GetClassName();
 
     //TODO: Use a string resource for html error text format
-    printf(MapAgentStrings::StatusHeader, 559, MG_WCHAR_TO_CHAR(statusMessage));
+    printf(MapAgentStrings::StatusHeader, 559, MG_WCHAR_TO_CHAR(shortError));
     printf(MapAgentStrings::ContentTypeHeader, MapAgentStrings::TextHtml, MapAgentStrings::Utf8Text);
     printf("\r\n"
         "<html>\n<head>\n"
Index: Web/src/IsapiAgent/IsapiResponseHandler.cpp
===================================================================
--- Web/src/IsapiAgent/IsapiResponseHandler.cpp	(revision 4040)
+++ Web/src/IsapiAgent/IsapiResponseHandler.cpp	(working copy)
@@ -54,7 +54,7 @@
             //TODO: Use a resource for the HTML error message
             STRING shortError = result->GetErrorMessage();
             STRING longError = result->GetDetailedErrorMessage();
-            sprintf(tempHeader, MapAgentStrings::StatusHeader, status, MG_WCHAR_TO_CHAR(statusMessage));
+            sprintf(tempHeader, MapAgentStrings::StatusHeader, status, MG_WCHAR_TO_CHAR(shortError));
             sResponseHeader.append(tempHeader);
             sprintf(tempHeader, MapAgentStrings::ContentTypeHeader, MapAgentStrings::TextHtml, "");
             sResponseHeader.append(" ");
@@ -62,7 +62,7 @@
             sResponseHeader.append(MapAgentStrings::CrLf);
             m_pECB->dwHttpStatusCode = (DWORD)status;
             char tempStatus[4096];
-            sprintf(tempStatus, "%d %s", status, MG_WCHAR_TO_CHAR(statusMessage));
+            sprintf(tempStatus, "%d %s", status, MG_WCHAR_TO_CHAR(shortError));
             WriteHeader(sResponseHeader.c_str(), tempStatus);
             WriteContext("\r\n"
                 "<html>\n<head>\n"
@@ -193,14 +193,14 @@
     string sResponseHeader;
     char tempHeader[4096];
 
-    sprintf(tempHeader, MapAgentStrings::StatusHeader, 559, MG_WCHAR_TO_CHAR(statusMessage));
+    sprintf(tempHeader, MapAgentStrings::StatusHeader, 559, MG_WCHAR_TO_CHAR(shortError));
     sResponseHeader.append(tempHeader);
     sprintf(tempHeader, MapAgentStrings::ContentTypeHeader, MapAgentStrings::TextHtml, MapAgentStrings::Utf8Text);
     sResponseHeader.append(tempHeader);
     sResponseHeader.append(MapAgentStrings::CrLf);
     m_pECB->dwHttpStatusCode = (DWORD)status;
     char tempStatus[4096];
-    sprintf(tempStatus, "%d %s", status, MG_WCHAR_TO_CHAR(statusMessage));
+    sprintf(tempStatus, "%d %s", status, MG_WCHAR_TO_CHAR(shortError));
     WriteHeader(sResponseHeader.c_str(), tempStatus);
     WriteContext("\r\n"
         "<html>\n<head>\n"

