Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error handling #19

Open
seriousme opened this issue Mar 18, 2018 · 0 comments
Open

error handling #19

seriousme opened this issue Mar 18, 2018 · 0 comments

Comments

@seriousme
Copy link

the vote app submits any data you throw at it into the queue.
https://github.com/subfuzion/docker-voting-app-nodejs/blob/master/src/vote/app.js#L32

Only at database level the body of the post operation is verified
https://github.com/subfuzion/docker-voting-app-nodejs/blob/master/src/database/lib/Database.js#L211

validating at the vote app level will ensure that only valid data is submitted to the queue and also simplifies error handling towards the client. It also reduces risk as there is no chance of unknown data of unknown size being queued.

Ideally the interface between voter and vote would be documented in an OpenApi (aka swagger) spec so code can be generated for both client and server which will automatically include validity checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant