Returns empty string instead of null in html clients if an error occurs