Improve browser error handling