aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-09-27 13:37:01 +0000
committerGodin <mandrikov@gmail.com>2010-09-27 13:37:01 +0000
commita6071ca39f147f61cfb1dec136d484cba814eba5 (patch)
treefb551f1a91e9b68e2c355712b4f2deefd1eefbab /sonar-server/src
parentf854c3c8f0c684e27e2543425ae5a1b60f4ad295 (diff)
downloadsonarqube-a6071ca39f147f61cfb1dec136d484cba814eba5.tar.gz
sonarqube-a6071ca39f147f61cfb1dec136d484cba814eba5.zip
SONAR-1709: Set HTTP status code in StaticResourcesServlet in case of error
Diffstat (limited to 'sonar-server/src')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java b/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java
index 5b5366a51c2..c86cc6b64f9 100644
--- a/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java
+++ b/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java
@@ -29,6 +29,7 @@ public class StaticResourcesServlet extends HttpServlet {
ClassLoader classLoader = pluginClassLoaders.getClassLoader(pluginKey);
if (classLoader == null) {
LOG.error("Plugin not found: " + pluginKey);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
InputStream in = null;
@@ -40,9 +41,11 @@ public class StaticResourcesServlet extends HttpServlet {
IOUtils.copy(in, out);
} else {
LOG.error("Unable to find resource '" + resource + "' in plugin '" + pluginKey + "'");
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
} catch (Exception e) {
LOG.error("Unable to load static resource '" + resource + "' from plugin '" + pluginKey + "'", e);
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} finally {
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(out);