- Make theme files and history.txt return 403 on error,

not 500, to avoid the new error page
This commit is contained in:
zzz
2010-12-31 13:13:26 +00:00
parent 544563672c
commit dcb9d38114
2 changed files with 10 additions and 2 deletions

View File

@ -8,5 +8,9 @@
*/ */
response.setContentType("text/plain"); response.setContentType("text/plain");
String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath(); String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath();
net.i2p.util.FileUtil.readFile("history.txt", base, response.getOutputStream()); try {
net.i2p.util.FileUtil.readFile("history.txt", base, response.getOutputStream());
} catch (java.io.IOException ioe) {
response.sendError(403, ioe.toString());
}
%> %>

View File

@ -44,5 +44,9 @@ if (themePath != null)
else else
base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath() + base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath() +
java.io.File.separatorChar + "docs"; java.io.File.separatorChar + "docs";
net.i2p.util.FileUtil.readFile(uri, base, response.getOutputStream()); try {
net.i2p.util.FileUtil.readFile(uri, base, response.getOutputStream());
} catch (java.io.IOException ioe) {
response.sendError(403, ioe.toString());
}
%> %>