Improves error handling in html clients