dtrugman / pfs

Parsing the Linux procfs
Apache License 2.0
99 stars 33 forks source link

Exceptions could potentially report the exact field that raised them #37

Open dtrugman opened 1 year ago

dtrugman commented 1 year ago

Raised by @Alston-Tang in #33, all parsers would throw an exception saying where parsing failed, but the information could be better, for example:

    catch (const std::invalid_argument& ex)
    {
        throw parser_error("Corrupted block stat - Invalid argument", line);

If we could find a way to include the actual field name in the exception, that could be great.