OpenCLTBrigade / cmpd-holiday-gift

CMPD Explorers Christmas Project
MIT License
11 stars 24 forks source link

Requests that don't return JSON throw errors. #209

Closed chimon2000 closed 6 years ago

chimon2000 commented 6 years ago

There are some requests in the app that do not return JSON. This causes errors on the client side. Should have a standard way of handling these errors.

I'm submitting a:

Expected behavior: Missing JSON should not cause requests to fail horribly. Validation errors should parse correctly.

Current behavior: Missing JSON payloads cause error dialog to be displayed.

Possible Solution Solution 1: Return JSON on every request, but that is probably overkill.

Solution 2: Attempt to parse JSON and return status if error thrown. Add logic back to parse validation errors.

Steps to reproduce: (for bugs) n/a

Context: Error dialog displayed when it shouldn't be.

Your Environment: All