I am using a GWT Form. In the form.addSubmitCompleteHandler() I do the following:
try {
Info = JSONParser.parseStrict(event.getResults()).isObject();
} catch (NullPointerException e) {
RootPanel.get("list").clear();
RootPanel.get("list").add(new HTML("<p><NullPointerException: "
+ e.getMessage() + "<br/><kbd>"
+ event.getResults() + "</kbd></p>"));
return;
} catch (IllegalArgumentException e) {
RootPanel.get("list").clear();
RootPanel.get("list").add(new HTML("<p>IllegalArgumentException: "
+ e.getMessage() + "<br/><kbd>"
+ event.getResults() + "</kbd></p>"));
return;
} catch (Exception e) {
RootPanel.get("list").clear();
RootPanel.get("list").add(new HTML("<p>Exception: " + e.getMessage()
+ "<br/>Cause: " + e.getCause()
+ "<br/><kbd>"
+ event.getResults() + "</kbd></p>"));
return;
}
{"table":{"MOLINE.EWR.UIND.EDU":{"SONGS":[["07/04/2012 12:23:37","07/04/2012 12:51:16",0.4608,""]]}}}
The "catch (Exception e)" case reports: "Exception: Error parsing JSON: SyntaxError: Unexpected token <
Cause: null"