When a product is deleted after it has been ordered, the ProductRepository will throw an exception when trying to load the product for the credit memo item. Because this exception is never caught in the RefundOrderInventoryObserver, this results in a bug where you can't refund orders for products that have been deleted.
Catching the exception makes sure that the observer does not interfere with the refund process. Since there will be no stock for a credit memo item whose product has been deleted, we can just continue.
This fixes https://github.com/elgentos/magento2-inventory-log/issues/10
When a product is deleted after it has been ordered, the ProductRepository will throw an exception when trying to load the product for the credit memo item. Because this exception is never caught in the RefundOrderInventoryObserver, this results in a bug where you can't refund orders for products that have been deleted.
Catching the exception makes sure that the observer does not interfere with the refund process. Since there will be no stock for a credit memo item whose product has been deleted, we can just
continue
.