Skip to content

Accessing source context on errors #437

Open
@CLOVIS-AI

Description

@CLOVIS-AI

Hi,

I am working on a project with a complex parser that pulls data from Source. If incorrect data is fed in, the parser throws an exception. The problem is that it's very hard to know which part of the data was incorrect, since the exception contains no context.

The idea behind this feature would be to add access some kind of data so the parser can add the "source location" in the thrown exception. For example, the name of the file, and the line number and column number of the last byte read through the source. Maybe the contents of the source as well.

This feature seems to be needed by most tools that would use kotlinx-io, so I assume there is already a way to access this context, but I did not find it myself.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions