BridgesUNCC / bridges-java

JAVA Client library for Bridges
http://bridgesuncc.github.io
GNU General Public License v2.0
4 stars 12 forks source link

Error reporting for JSON errors #100

Open squeetus opened 7 years ago

squeetus commented 7 years ago

The client receives a specific error when the POSTed JSON fails on the server:

There was a problem sending the visualization representation to the server. Are you connected to the Internet? Check your network settings. Otherwise, maybe the central DataFormatters server is down. Try again later.
Server reported an error while serving request: SyntaxError: Unexpected token [TOKEN] in JSON at position [POSITION] invalid syntax for raw body of request

We could trap SyntaxError: Unexpected token ... errors and instruct users to check their node labels for special characters to give better feedback.

AlecGoncharow commented 5 years ago

Is this safe to close?

squeetus commented 5 years ago

The server has been modified to give better response codes in the assignment api here https://github.com/squeetus/bridgesAPI/commit/cc16bba0bb53055ad015532312aa643512617972.

However, the client has not been updated to account for these. At least in this Java version, we only watch for 503 and >400 status codes.

Recommend keeping open, but this is not crucial.

esaule commented 5 years ago

the c++ client dies the same way on 400 or 500 with only the error code from the server that changes. I expect the java and python clients will do the same. So it is indeed not critical. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.