Open
Description
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.