jeudi 25 mars 2021

Why do so many libs have their own base Exception class?

I recently noticed that a lot of libraries and frameworks bring their own base Exception class. The list is quite long.

enter image description here

When checking the code I only find them to be empty and extending PHPs own Exception class or another empty class which then extends PHPs base Exception. For example in PHPUnit:

https://github.com/sebastianbergmann/phpunit/blob/master/src/Util/Exception.php

Does every lib has it's own reasons to do so or is there some general concept I'm not aware of?

Aucun commentaire:

Enregistrer un commentaire