wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

Catch Action Scheduler exceptions

Open remyperona opened this issue 2 years ago • 0 comments

Action Scheduler functions to enqueue or schedule action can throw exceptions when an error happens. Exceptions are going to create fatal errors on website if not caught. We have seen this happen when the tables were missing for example.

We added guards to recreate the tables when they are missing, but there is other cases where exceptions could be thrown, so we should guard against them wherever we use AS functions, with the use of try/catch clauses.

remyperona avatar Sep 21 '22 13:09 remyperona