Remove console.log statements.
Dispatch "error" event when something went wrong.