commit | 16899eba67050245cdb58592fd9c1fdc035aa4a0 | [log] [tgz] |
---|---|---|
author | Valentin Pavlov Valchev <vvalchev@apache.org> | Wed Apr 04 14:21:06 2012 +0000 |
committer | Valentin Pavlov Valchev <vvalchev@apache.org> | Wed Apr 04 14:21:06 2012 +0000 |
tree | 476a1fccd29c00a2657807f7088e3843176c5996 | |
parent | f1bbf9cea42f9a15c6a4ec003dfa3eaa14231be3 [diff] |
Fixed FELIX-3434 UPnP plugin should give better error description when invoke action fails https://issues.apache.org/jira/browse/FELIX-3434 git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1309406 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java b/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java index 88e580d..267e487 100644 --- a/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java +++ b/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java
@@ -180,12 +180,17 @@ } 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(); } }