Handling promise-based errors so they don't appear in console. Fixes #8.