Skip to content

Commit 979be05

Browse files
committed
KUSTOM-55 Fix error message when klarna api exception is thrown
1 parent 248e998 commit 979be05

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
11.0.17 / 2026-03-05
2+
==================
3+
4+
* KUSTOM-55 Fix missing error message when Klarna API exception is thrown
5+
16
11.0.15 / 2026-02-18
27
==================
38

Model/Api/Rest/Service.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,15 @@ public function makeRequest(
179179
}
180180
$response = array_merge($response, $body);
181181
}
182+
if (!isset($response['error_messages'])) {
183+
$response['error_messages'] = [$e->getMessage()];
184+
}
182185
$response['exception_code'] = $e->getCode();
183186
} catch (\Exception $e) {
184187
$this->log->critical($e);
188+
if (!isset($response['error_messages'])) {
189+
$response['error_messages'] = [$e->getMessage()];
190+
}
185191
$response['exception_code'] = $e->getCode();
186192
}
187193

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Kustom Base Magento 2 Extension",
44
"type": "magento2-module",
55
"license": "Apache-2.0",
6-
"version": "11.0.16",
6+
"version": "11.0.17",
77
"scripts": {
88
"test": "phpunit",
99
"cov": "phpunit --coverage-html coverage"

0 commit comments

Comments
 (0)