The below is copied from a comment made by myself in the above pull request:
...in certain exceptional situations, the server returns an error from node.js (with file paths and package names) rather than a custom error message. For example, calling /login with no parameters results in the following response:
URL: http://localhost/login?
Response body:
SyntaxError: Unexpected token u in JSON at position 0
at Object.parse (native)
at C:\<Gradebook repo path>\Gradebook\src\webapp\gradebookServer.js:123:54
at Layer.handle [as handle_request] (C:\<Node.js Path>\node_modules\express\lib\router\layer.js:95:5)
at next (C:\<Node.js Path>\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\<Node.js Path>\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\<Node.js Path>\node_modules\express\lib\router\layer.js:95:5)
at C:\<Node.js Path>\node_modules\express\lib\router\index.js:281:22
at Function.process_params (C:\<Node.js Path>\node_modules\express\lib\router\index.js:335:12)
at next (C:\<Node.js Path>\node_modules\express\lib\router\index.js:275:10)
at expressInit (C:\<Node.js Path>\node_modules\express\lib\middleware\init.js:40:5)
I'm not sure if this is the best places for it, but I would like to document some of the other ways the server may misbehave in exceptional situations as they are found:
Trying to connect to a database that does not exist on the Postgres server causes the Node.js server to crash.
Initially brought to attention in Pull Request 42.
The below is copied from a comment made by myself in the above pull request:
...in certain exceptional situations, the server returns an error from node.js (with file paths and package names) rather than a custom error message. For example, calling
/login
with no parameters results in the following response:URL:
http://localhost/login?
Response body: