Adding error handling to web workers