Change threading formatter errors to warnings.

This change standardizes threading formatter error handling and moves
the remaining error calls to be warnings instead.

This is in line with already existing code - in most cases warnings were
raised, only a few cases raised errors. These cases do not differ
significantly from other cases in which warnings are raised.

This also fixes GH-692, in which misformatted lines prevent future file
parsing.

This commit also moves the FailWarn method that is used by both the
config and the ascii reader up to the ReaderBackend. Furthermore it
makes the Warning method of ReaderBackend respect the warning
suppression that is introduced by the FailWarn method.
This commit is contained in:
Johanna Amann 2020-02-04 16:10:10 -08:00
parent 5171f25e3a
commit deaab42187
12 changed files with 90 additions and 70 deletions

View file

@ -199,7 +199,7 @@ bool Ascii::Describe(ODesc* desc, threading::Value* val, const string& name) con
}
default:
GetThread()->Error(GetThread()->Fmt("Ascii writer unsupported field format %d", val->type));
GetThread()->Warning(GetThread()->Fmt("Ascii writer unsupported field format %d", val->type));
return false;
}
@ -346,7 +346,7 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag
}
}
GetThread()->Error(GetThread()->Fmt("String '%s' contained no parseable pattern.", candidate.c_str()));
GetThread()->Warning(GetThread()->Fmt("String '%s' contained no parseable pattern.", candidate.c_str()));
goto parse_error;
}