Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reporting request #32

Open
drekka opened this issue Jun 30, 2015 · 0 comments
Open

Error reporting request #32

drekka opened this issue Jun 30, 2015 · 0 comments

Comments

@drekka
Copy link

drekka commented Jun 30, 2015

Hi. I'm parsing a simple string that looks like this:

[Abc]

This parses fine, but when the app checks 'Abc', it's not valid so I'm raising an error by using the [parser raise:@"..."]; statement.

At the moment I get an error which when dumped to the logs, looks like this:

Error Domain=PEGKitErrorDomain Code=1 "Failed to match next input token" UserInfo=0x7f9a7b710710 {NSLocalizedDescription=Failed to match next input token, range=NSRange: {9223372036854775807, 5}, lineNumber=Unknown, NSLocalizedFailureReason=Unable to find any runtime object called Abc
Line : Unknown
}

My error message seems to only be accessible through the localizedFailureReason and wrapped with line feeds. IN my case I want to do other things with it.

I'd like to have the peg kit actually put my error message as the description. I'm also not sure what the range is meant to represent as any time I see an error, it always seems to be x,5. With neither the 5 or the 5 having anything to do with the location of error as far as I can tell.

Can this be improved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant