Skip to content

Better Error Messages for Text Format Parsing #91

@AaronWebster

Description

@AaronWebster

This issue was copied from the upstream repository google/emboss.

Original issue: google#27
Original state: open, created at: 2022-02-15T22:47:57Z, updated at: 2024-12-18T23:15:24Z, by @reventlov


Original description

UpdateFromText() just returns a bool indicating success/failure. There is currently no way to find out where parsing failed, which makes it difficult to debug manually-written text format structs.


Discussion (copied comments)

Comment by @reventlov on 2023-05-04T23:55:45Z:

The implementation of this is probably to update the C++ UpdateFromTextStream() methods to take an optional output parameter, or to build a parallel API like UpdateFromTextStreamOrReturnError(). I haven't given a lot of thought to the best way to actually return the error(s). Right now, the update bails out if there is any error, but I can imagine having an allow_partial_update option similar to the allow_partial_output option for text output, so ideally the API would allow multiple errors to be returned.

A (maybe) comprehensive list of the places that are are likely to need to be changed:


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions