-
Notifications
You must be signed in to change notification settings - Fork 1
Main loop and handling exceptions
vazexqi edited this page Feb 22, 2013
·
2 revisions
It is vital to wrap the main loop of your program with a try...catch block.
Assuming that one of your first lines is to poll the submission queue, there are several things that can happen in the grader:
- The host is down with a '502 - Internal Server Error'.
groovyx.net.http.HttpResponseException: Internal Server Error
at groovyx.net.http.HTTPBuilder.defaultFailureHandler(HTTPBuilder.java:634) ~[http-builder-0.7-SNAPSHOT.jar:na]
- The queue is not accessible at that moment
- It returns a malformed response (text/html) that your parser just cannot parse
Caused by: groovy.json.JsonException: Lexing failed on line: 1, column: 1, while reading '<', no possible valid JSON value or punctuation could be recognized.