felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvalc...@apache.org
Subject svn commit: r1309406 - /felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java
Date Wed, 04 Apr 2012 14:21:07 GMT
Author: vvalchev
Date: Wed Apr  4 14:21:06 2012
New Revision: 1309406

URL: http://svn.apache.org/viewvc?rev=1309406&view=rev
Log:
Fixed FELIX-3434 UPnP plugin should give better error description when invoke action fails
https://issues.apache.org/jira/browse/FELIX-3434

Modified:
    felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java

Modified: felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java?rev=1309406&r1=1309405&r2=1309406&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java
(original)
+++ felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java
Wed Apr  4 14:21:06 2012
@@ -180,12 +180,17 @@ public class ControlServlet extends Http
         }
         catch (ServletException e)
         {
-            throw e;
+            response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+            response.setContentType("text/plain"); //$NON-NLS-1$
+            e.printStackTrace(response.getWriter());
+            response.flushBuffer();
         }
         catch (Exception e)
         {
-            e.printStackTrace();
-            throw new ServletException(e.toString());
+            response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+            response.setContentType("text/plain"); //$NON-NLS-1$
+            e.printStackTrace(response.getWriter());
+            response.flushBuffer();
         }
     }
 



Mime
View raw message