Sorry,
i mean trigger_error
https://www.php.net/manual/fr/function.trigger-error.php
or throw new Exception(
“custom message”);
And maybe return false or better return new WP_Error(“custom message”); when error occur. And check with is_wp_error on line 99 just before other tests.
Because now your function return true every time, even it don’t work as expected.
I wish something where i can know error occurs and then know what i can fix. Today was because of security settings of Imagick that doesnot allow pdf reading, and without anything on screen i cant know that.
Thank you for reading