Skip to content

Commit 930245b

Browse files
authored
Убрано безпричинное бросение исключения (#40)
1 parent af8a76c commit 930245b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Delivery/NovaPoshtaApi2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private function prepare($data)
192192
? $data
193193
: json_decode($data, true);
194194
// If error exists, throw Exception
195-
if ($this->throwErrors and array_key_exists('errors', $result)) {
195+
if ($this->throwErrors and array_key_exists('errors', $result) and $result['errors']) {
196196
throw new \Exception(is_array($result['errors']) ? implode("\n", $result['errors']) : $result['errors']);
197197
}
198198
return $result;

0 commit comments

Comments
 (0)