improved error messages parsing