Added exception handling in the main loop for the web server to avoid the main loop thread getting killed off due to an unexpected/unhandled exception.

Moved code for JSON handling and metadata/metadata container into the Common project from the Foundation project.
This commit is contained in:
wcrisman
2014-09-16 14:01:31 -07:00
parent 1a8fd62dd8
commit b48e81bfe0
39 changed files with 930 additions and 994 deletions

View File

@@ -31,12 +31,17 @@ public ResourceRequestHandler() {
try {
InputStream in = getClass().getClassLoader().getResourceAsStream("framework.js");
try {
frameworkJavascript = StreamSupport.readText(in, "UTF8");
}//try//
finally {
try {in.close();} catch(Throwable e) {}
}//finally//
if(in != null) {
try {
frameworkJavascript = StreamSupport.readText(in, "UTF8");
}//try//
finally {
try {in.close();} catch(Throwable e) {}
}//finally//
}//if//
else {
Debug.log("Warning: framework.js not found!");
}//else//
}//try//
catch(Throwable e) {
Debug.log("Failed to read the framework.js file from the framework jar.", e);