Added error handling to the output JSON

This should help pretty things up until some better in-script error
handling is put together. Not sure of the script will refresh when it
hits the error, either.