Better error handler

This should give us more informative error messages in the console.

— AP DT