How to use retry functionality of specific failed API call by use of PHP Magento 2?

You can use retry functionality to re-use your existing API call while you deal with some third-party API access.

If your request failed and you want to give more chances to connect with third-party API, you can use the retry functionality to wait up to a few seconds before throwing an error for an API call.

I have given a demo to call specific API up to three times based on the delay of 5 seconds, 10 seconds, and 15 seconds. Continue reading “How to use retry functionality of specific failed API call by use of PHP Magento 2?”

Class Vendor\Module\Model\Interceptor does not exist exception error Magento 2.

Sometimes you face an exception error after installing the module via composer or by some other ways, you will able to see an exception error on the website or while running the setup upgrade or cache flush command.

Exception.log Error:

{“exception”:”[object] (ReflectionException(code: -1): Class Vendor\Module\Model\ResourceModel\Banner\Interceptor does not exist.

Continue reading “Class Vendor\Module\Model\Interceptor does not exist exception error Magento 2.”

Typed property must not be accessed before initialization Exception PHP Magento.

From PHP 7.4 Onwards, PHP introduced type hinting for all the properties. Based on the Type Hinting you need to assign proper value to match with that type.

Like, private int $size = 10;Here 10 is the default value for the $size variable.

Exception on Browser,

Typed property DataProvider::$loadedData must not be accessed before initialization, Exception in DataProvider.php class.

Continue reading “Typed property must not be accessed before initialization Exception PHP Magento.”