[GH-ISSUE #24] The JSON parser throws an unhandled exception upon receiving ill-formatted input #10

Closed
opened 2026-09-04 00:21:33 +02:00 by Stone_Red · 4 comments
Owner

Originally created by @stephan418 on GitHub (Dec 30, 2021).
Original GitHub issue: https://github.com/detleph/server/issues/24

Originally assigned to: @Stefan-5422 on GitHub.

The traceback is then forwarded to the client, which is, however, expecting a standard error response

Originally created by @stephan418 on GitHub (Dec 30, 2021). Original GitHub issue: https://github.com/detleph/server/issues/24 Originally assigned to: @Stefan-5422 on GitHub. The traceback is then forwarded to the client, which is, however, expecting a standard error response
Author
Owner

@Stefan-5422 commented on GitHub (Jan 1, 2022):

Where is this standard responses detailed?

Also where is the documentation you were writing?

<!-- gh-comment-id:1003599462 --> @Stefan-5422 commented on GitHub (Jan 1, 2022): Where is this standard responses detailed? Also where is the documentation you were writing?
Author
Owner

@stephan418 commented on GitHub (Jan 2, 2022):

The standard response is detailed nowhere, but it should use the format all other endpoints use (with type and payload fields; ref: https://github.com/detleph/server/blob/5b02905d7169a0a1b272fadf22aa178d084f4dbe/src/Controllers/admin.controller.ts#L181)

And I have documentation for the event endpoints. I stopped working on it, however, as it took me nearly 3 hours to write only this part (which is a fraction of the whole thing) and I don't think that is viable for such a limited-use API.

<!-- gh-comment-id:1003723607 --> @stephan418 commented on GitHub (Jan 2, 2022): The standard response is detailed nowhere, but it should use the format all other endpoints use (with type and payload fields; ref: https://github.com/detleph/server/blob/5b02905d7169a0a1b272fadf22aa178d084f4dbe/src/Controllers/admin.controller.ts#L181) And I have documentation for the event endpoints. I stopped working on it, however, as it took me nearly 3 hours to write only this part (which is a fraction of the whole thing) and I don't think that is viable for such a limited-use API.
Author
Owner

@stephan418 commented on GitHub (Jan 2, 2022):

And the error occurs whenever data which is not parsable by the JSON parser is sent to the server (for example the string "test"). When this is done, a 400 response with a plain-text traceback is returned

<!-- gh-comment-id:1003724216 --> @stephan418 commented on GitHub (Jan 2, 2022): And the error occurs whenever data which is not parsable by the JSON parser is sent to the server (for example the string "test"). When this is done, a 400 response with a plain-text traceback is returned
Author
Owner

@Stefan-5422 commented on GitHub (Feb 27, 2022):

Note: This is reffring to the express json parser which will just return a stack trace instead of a normal response.

<!-- gh-comment-id:1053640516 --> @Stefan-5422 commented on GitHub (Feb 27, 2022): Note: This is reffring to the express json parser which will just return a stack trace instead of a normal response.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: detleph/server#10