     {
         removeURLCheckerListeners();
 
+        var fault:Fault = event.fault;
+
+        var isPortalErrorResponse:Boolean = fault.content
+            && fault.content.hasOwnProperty("code")
+            && fault.content.hasOwnProperty("message");
+        if (isPortalErrorResponse)
+        {
+            resetURLAdjusting();
+            displayInvalidURL(getInvalidMessage(fault));
+            return;
+        }
+
         if (isAdjustingURL && hasTriedExistingInstanceEndPoint
             && hasTriedDefaultInstanceEndPoint && hasTriedPortalEndPoint)
         {
             resetURLAdjusting();
-            displayInvalidURL(getInvalidMessage(event.fault));
+            displayInvalidURL(getInvalidMessage(fault));
             return;
         }
         else

            }

            resetURLAdjusting();
            displayInvalidURL(getInvalidMessage(event.fault));
        }
    }


import com.esri.builder.supportClasses.PortalUtil;
import com.esri.builder.supportClasses.URLUtil;

import mx.rpc.Fault;
import mx.rpc.events.FaultEvent;
import mx.utils.URLUtil;

