yandex / pire

Perl Incompatible Regular Expressions library
http://github.com/dprokoptsev/pire/wiki
Other
330 stars 30 forks source link

Validate scanner: more informative error messages #14

Open starius opened 9 years ago

starius commented 9 years ago

Replace universal error message "Serialized regexp incompatible with your system" with more specific messages like "Bad MaxWordSize in serialized regexp. Expected ... Found ...".

dprokoptsev commented 9 years ago

Your pull request surely might benefit from a motivation and rationale section. I believe it's doing more harm than good at this point

Imagine yourself in your ops' shoes, receiving "Bad PtrSize..." error message from a arcane piece of software using pire you know next to nothing about -- how you're going to fix that not diving into pire internals? More generic error messages like "Incompatible regexp / Broken regexp / Regexp version mismatch" surely provide better diagnostics.

starius commented 9 years ago

More generic error messages provide less information useful to debug. If a user gets this message and sends it to a developer, then the latter can't distinguish various possible sources of this problem.

Maybe better option is to provide both: "You are trying to used an incompatible version of a serialized regexp: value of field MAGIC is wrong. Expected X, found Y."