Exception logging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.openautonomousconnection.webserver.api;
|
||||
|
||||
import org.openautonomousconnection.protocol.packets.v1_0_1.beta.web.impl.resource.WebResourceResponsePacket;
|
||||
import org.openautonomousconnection.webserver.Main;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.html.HTMLBodyElement;
|
||||
@@ -23,26 +24,27 @@ public abstract class WebPage {
|
||||
private static final DocumentBuilder documentBuilder;
|
||||
|
||||
static {
|
||||
DocumentBuilder temp = null;
|
||||
try {
|
||||
documentBuilder = factory.newDocumentBuilder();
|
||||
temp = factory.newDocumentBuilder();
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Main.getValues().logger.exception("Failed to create document builder", e);
|
||||
temp = null;
|
||||
}
|
||||
|
||||
protected Document document;
|
||||
documentBuilder = temp;
|
||||
}
|
||||
|
||||
protected HTMLBodyElement body;
|
||||
protected final Document document;
|
||||
protected final HTMLHeadElement head;
|
||||
protected final HTMLBodyElement body;
|
||||
|
||||
protected HTMLHeadElement head;
|
||||
/**
|
||||
* Default constructor that creates a new Document instance
|
||||
*/
|
||||
public WebPage() {
|
||||
this.document = documentBuilder.newDocument();
|
||||
|
||||
this.head = (HTMLHeadElement) this.document.createElement("head");
|
||||
|
||||
this.body = (HTMLBodyElement) this.document.createElement("body");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user