get(StockRepositoryInterface::class); try { $stockRepository->deleteById(10); } catch (NoSuchEntityException $e) { //Stock already removed }