DASSL / Gradebook

Open-source product to provide a practical means for instructors to record student attendance and assessment
Other
8 stars 4 forks source link

Web server responds with node.js stack trace instead of error message in certain exceptional situations (WE) #44

Closed afig closed 7 years ago

afig commented 7 years ago

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:

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)
wildtayne commented 7 years ago

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: