Request, and handle, errors in XML format when loading map data
[potlatch2.git] / net / systemeD / halcyon / connection / XMLConnection.as
index 0bf342d..6a22bf4 100644 (file)
@@ -57,6 +57,7 @@ package net.systemeD.halcyon.connection {
                        mapLoader.addEventListener(Event.COMPLETE, loadedMap);
                        mapLoader.addEventListener(IOErrorEvent.IO_ERROR, errorOnMapLoad);
                        mapLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, mapLoadStatus);
+            request.requestHeaders.push(new URLRequestHeader("X-Error-Format", "XML"));
                        mapLoader.load(request);
                        dispatchEvent(new Event(LOAD_STARTED));
                }
@@ -179,7 +180,8 @@ package net.systemeD.halcyon.connection {
             urlReq.method = "POST";
                        if (xml) { urlReq.data = xml.toXMLString(); } else { urlReq.data = true; }
             urlReq.contentType = "application/xml";
-            urlReq.requestHeaders = new Array(new URLRequestHeader("X_HTTP_METHOD_OVERRIDE", "PUT"));
+            urlReq.requestHeaders = [ new URLRequestHeader("X_HTTP_METHOD_OVERRIDE", "PUT"), 
+                                                 new URLRequestHeader("X-Error-Format", "XML") ];
             var loader:URLLoader = new URLLoader();
             loader.addEventListener(Event.COMPLETE, onComplete);
             loader.addEventListener(IOErrorEvent.IO_ERROR, onError);