consumerreports / ccpa-authorized-agent

MIT License
3 stars 4 forks source link

Make db errors user-friendly, sanitize #5

Open moates opened 3 years ago

moates commented 3 years ago

I accidentally put in an extra number in a zip code and got back a raw 500 error message that appears to be coming directly from the backend. Should probably use form validation for that field instead.

"value too long for type character varying(5)"

rrix commented 3 years ago

when i tested e552d1c491a130c70d51bdf8426371c559282ca1 in #6 i noticed that /members/sign-up will happily create a Member with null values; In the heroku production console there are a bunch of logs on startup that mirror the errors I got from the verification reminder thingy once it persisted the null Member.

we should add some simple validation so that curl -XPOST http://localhost:5000/member/sign-up raises a 500 and some validation errors (and could catch the ZIP code before it hits the DB :) )