Managing errors that are not in json format