How do I distinguish JSON decoding errors from other errors?