CocoaPods / Nanaimo

A native ruby implementation of ASCII plist parsing & serializing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide line number in error messages

orta opened this issue · comments

Ideally if something like this comes up CocoaPods/CocoaPods#6101 (comment)

Nanaimo::Reader::ParseError - not a valid string at index 114798 (char is "$")
/Library/Ruby/Gems/2.0.0/gems/nanaimo-0.1.1/lib/nanaimo/reader.rb:251:in `raise_parser_error'
/Library/Ruby/Gems/2.0.0/gems/nanaimo-0.1.1/lib/nanaimo/reader.rb:116:in `parse_string'

It'd be good to say

Nanaimo::Reader::ParseError - not a valid string on line 432 row 233 (char is "$")
/Library/Ruby/Gems/2.0.0/gems/nanaimo-0.1.1/lib/nanaimo/reader.rb:251:in `raise_parser_error'
/Library/Ruby/Gems/2.0.0/gems/nanaimo-0.1.1/lib/nanaimo/reader.rb:116:in `parse_string'

Extra credit for:

Nanaimo::Reader::ParseError - not a valid string on line 432 row 233 (char is "$")

> [the actual line of code]  

/Library/Ruby/Gems/2.0.0/gems/nanaimo-0.1.1/lib/nanaimo/reader.rb:251:in `raise_parser_error'
/Library/Ruby/Gems/2.0.0/gems/nanaimo-0.1.1/lib/nanaimo/reader.rb:116:in `parse_string'

I thought I did that?

Ah the error just has a location property already, this shouldn't be too hard to wire up