inaimathi/cl-leet

Resolve errors

Closed this issue · 1 comments

Right now, a few places raise errors if the user does something odd (like purchase more goods than fit in their cargo hold, purchase a good not available on the current planet, etc.)

This is an artifact of the original command-line version of the game, and shouldn't still be the case. In the event of attempting to do something they can't, a user should first face a client-side validation function, followed by server-side validation that just redirects to the main interface without carrying out the command.

EDIT: I could resolve errors either by cleaning up expressly, or by tweaking the UI to make it much harder for an end user to cause one. This would be preferable, since theoretical API users would probably want to see errors (rather than a DWIM response) when they did something odd.

Check. I ended up resolving this by adding copious layers of user-facing validation and a kiddie-friendly UI. You really have to try to cause an error at this point (as in, modify javascript running on the page to put invalid entries into hidden inputs. At that point, you deserve any error you get)