Update index.js

The JSON.parse error is caught with a pseudo appropriate error message.