PHRETS icon indicating copy to clipboard operation
PHRETS copied to clipboard

All Exceptions should share a base class or interface

Open benglass opened this issue 9 years ago • 1 comments

All exceptions that are thrown by this library should subclass a base exception class such as PHRETS\Exceptions\RETSException OR implement a shared interface (with no methods) such as PHRETS\Exceptions\RETSExceptionInterface

The reason for this is that it would allow consumers of the library to catch and handle any exceptions thrown by the library rather than having to catch the generic PHP \Exception class (Pokemon exception handling, gotta catch em all)

If you are open to this I can submit a PR

benglass avatar Sep 27 '16 14:09 benglass

Sure, I'd entertain a PR for that. I've thought about a similar route with the exceptions Guzzle would throw for HTTP-related issues and whether or not integrators of PHRETS should need to know about the possibility of those underlying exceptions.

troydavisson avatar Oct 05 '16 23:10 troydavisson