Adds a global error handler on the client side, so we can log them on the server side