Provide line number in error messages
orta opened this issue · comments
Orta Therox commented
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'
Samuel Giddins commented
I thought I did that?
Samuel Giddins commented
Ah the error just has a location property already, this shouldn't be too hard to wire up