msoucy / dproto

D Protocol Buffer mixins to create structures at compile time
Boost Software License 1.0
37 stars 16 forks source link

no context shown on DProtoSyntaxException => should show line number #108

Open timotheecour opened 7 years ago

timotheecour commented 7 years ago

@msoucy I have a large proto file, and get this error:

~/.dub/packages/dproto-2.1.1/dproto/import/dproto/parse.d(511,11): Error: uncaught CTFE exception dproto.exception.DProtoSyntaxException("Expected an integer but was ``")

it should show offending line number otherwise really hard to fix

msoucy commented 7 years ago

Started on the error-lines branch (4cca795778af442038057e17cef569bebbd50f17)... It fixes scenarios where it's being run for just the string processing, but doesn't yet handle extracting the information from CTFE exceptions.

timotheecour commented 7 years ago

@msoucy also, is showing the contents of the entire proto necessary? if we had file:line i think showing file:line contents[line] would be enough

msoucy commented 7 years ago

So the reason that it displays the contents, is that it's not currently being caught so it's dumping the raw exception. I'll look into it