portals-portalapps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r1618526 - in /portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy: command/ResolveProxyMappingCommand.java util/YamlConfigUtils.java
Date Sun, 17 Aug 2014 22:56:57 GMT
Author: woonsan
Date: Sun Aug 17 22:56:57 2014
New Revision: 1618526

URL: http://svn.apache.org/r1618526
Log:
APA-61: better error log and exception handling

Modified:
    portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/ResolveProxyMappingCommand.java
    portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/util/YamlConfigUtils.java

Modified: portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/ResolveProxyMappingCommand.java
URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/ResolveProxyMappingCommand.java?rev=1618526&r1=1618525&r2=1618526&view=diff
==============================================================================
--- portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/ResolveProxyMappingCommand.java
(original)
+++ portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/ResolveProxyMappingCommand.java
Sun Aug 17 22:56:57 2014
@@ -52,7 +52,7 @@ public class ResolveProxyMappingCommand 
 
         if (resolvedMapping == null)
         {
-            throw new ReverseProxyException(HttpServletResponse.SC_NOT_FOUND, "No mapping
for " + localPath);
+            throw new ReverseProxyException(HttpServletResponse.SC_NOT_FOUND, "No mapping
found for '" + localPath + "'.");
         }
 
         context.setResolvedMapping(resolvedMapping);

Modified: portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/util/YamlConfigUtils.java
URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/util/YamlConfigUtils.java?rev=1618526&r1=1618525&r2=1618526&view=diff
==============================================================================
--- portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/util/YamlConfigUtils.java
(original)
+++ portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/util/YamlConfigUtils.java
Sun Aug 17 22:56:57 2014
@@ -112,29 +112,32 @@ public class YamlConfigUtils
 
         Iterable<Object> allObjects = loadYaml(constructor, yamlConfig, servletContextOrPortletContext);
 
-        for (Object item : allObjects)
+        if (allObjects != null)
         {
-            if (item instanceof Collection)
+            for (Object item : allObjects)
             {
-                for (Object mapping : (Collection<?>) item)
+                if (item instanceof Collection)
                 {
-                    if (mapping instanceof ProxyMapping)
+                    for (Object mapping : (Collection<?>) item)
                     {
-                        proxyMappings.add((ProxyMapping) mapping);
-                    }
-                    else
-                    {
-                        log.error("Invalid mapping type: {} - {}" + mapping.getClass(), mapping);
+                        if (mapping instanceof ProxyMapping)
+                        {
+                            proxyMappings.add((ProxyMapping) mapping);
+                        }
+                        else
+                        {
+                            log.error("Invalid mapping type: {} - {}" + mapping.getClass(),
mapping);
+                        }
                     }
                 }
-            }
-            else if (item instanceof ProxyMapping)
-            {
-                proxyMappings.add((ProxyMapping) item);
-            }
-            else
-            {
-                log.error("Invalid mapping type: {} - {}" + item.getClass(), item);
+                else if (item instanceof ProxyMapping)
+                {
+                    proxyMappings.add((ProxyMapping) item);
+                }
+                else
+                {
+                    log.error("Invalid mapping type: {} - {}" + item.getClass(), item);
+                }
             }
         }
 



Mime
View raw message