Skip to content

Commit 199887d

Browse files
author
Ash Smith
committed
Add more descriptive exception when data patch fails to apply.
Resolves #23045
1 parent 4b2bbc7 commit 199887d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/internal/Magento/Framework/Setup/Patch/PatchApplier.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,17 @@ public function applyDataPatch($moduleName = null)
164164
$this->moduleDataSetup->getConnection()->commit();
165165
} catch (\Exception $e) {
166166
$this->moduleDataSetup->getConnection()->rollBack();
167-
throw new Exception(new Phrase($e->getMessage()));
167+
throw new Exception(
168+
new Phrase(
169+
'Unable to apply data patch %1 for module %2. Original exception message: %3',
170+
[
171+
get_class($dataPatch),
172+
$moduleName,
173+
$e->getMessage()
174+
]
175+
),
176+
$e
177+
);
168178
} finally {
169179
unset($dataPatch);
170180
}

0 commit comments

Comments
 (0)