The goal is to allow the tidy extension to have its own exception type, TidyException, with which can be used for the tidy(p) C api usage, thinking about this while working at updating tidy to throw exception rather than raising warnings.
Nothing fancy, the TidyException would be as follow :
class TidyException extends Exception { }
try { $tidy->parseFile("does_not_exist.html"); } catch (TidyException $e) { // Cannot load "does_not_exist.html" into memory echo $e->getMessage(), PHP_EOL; }