Handle parsing errors in the example.

Aborting on invalid input is not especially user-friendly, even for a simple
example.