jbowens / jBBCode

A lightweight but extensible BBCode parser
http://jbbcode.com
MIT License
164 stars 32 forks source link

Let ParserException inherit from DomainException (or replace it entirely) #70

Closed DaSourcerer closed 7 years ago

DaSourcerer commented 7 years ago

This has bugged me for a while now: ParserException is by its semantics a clear candidate for inheriting from \DomainException (see also this SO discussion) instead of the generic \Exception.

However, given that ParserException is not exposed to any codepaths outside the parser, it would make sense to scrap it entirely and reduce the weight of the codebase. Any thoughts?

shmax commented 7 years ago

ParserException was my doing. I have no particular attachment to it, it just seemed to make sense at the time (as a means of aborting options parsing but still recovering), but as you've noticed wasn't otherwise very carefully thought out. If you want to replace, remove or re-parent it I for one will have no objection.