Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added: item-tracker implementation #107

Merged
merged 10 commits into from
Mar 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
Thijzer committed Mar 10, 2025
commit 6418de182c385ecca77709420a37cc9dea91f4e2
2 changes: 1 addition & 1 deletion src/Component/Akeneo/Client/Errors/AkeneoError.php
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ public function getField(): string
return $this->field;
}

public function getMessage(): string
public function getErrorMessage(): string
{
return $this->message;
}
12 changes: 7 additions & 5 deletions src/Component/Akeneo/Client/Errors/AkeneoErrorFactory.php
Original file line number Diff line number Diff line change
@@ -17,13 +17,15 @@ public static function createErrors($payload): AkeneoErrors

// Handle multi-payload response
if (is_array($payload) && isset($payload[0])) {
foreach ($payload as $msg) {
foreach (array_filter($payload) as $msg) {
$statusCode = $msg['status_code'] ?? $msg['code'] ?? null;
$id = $msg['identifier'] ?? $msg['code'] ?? 'unknown_id';
$errors[] = new AkeneoError(
$id,
implode(': ', array_filter([$statusCode, $msg['message']]))
);
if (isset($msg['message'])) {
$errors[] = new AkeneoError(
$id,
implode(': ', array_filter([$statusCode, $msg['message']]))
);
}

// Handle Errors
if (isset($msg['errors']) && is_array($msg['errors'])) {