Getting started

This is not a common way to report errors in JavaScript. As mentioned above, we should be using promises. You could then throw inside  a then clause and the promise will be rejected.