Skip to content

Commit

Permalink
Ensure first error message is retrieved
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnynotsolucky committed Nov 5, 2024
1 parent 7c499aa commit 8a4bf03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function generateXml(array $commerceOrders, int $pageCount): string
$firstFailedOrder = $failed->first();
$firstErrrors = $firstFailedOrder->getFirstErrors();
$attribute = key($firstErrrors);
$value = reset($firstErrrors[$attribute]);
$value = reset($firstErrrors);

throw new \RuntimeException("Invalid Order ID {$firstFailedOrder->getOrderId()}: {$attribute} - {$value}");
}
Expand Down

0 comments on commit 8a4bf03

Please sign in to comment.