We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4434901 + 30de729 commit 5686f76Copy full SHA for 5686f76
1 file changed
src/Delivery/NovaPoshtaApi2.php
@@ -190,7 +190,7 @@ private function prepare($data)
190
? $data
191
: json_decode($data, 1);
192
// If error exists, throw Exception
193
- if ($this->throwErrors and $result['errors']) {
+ if ($this->throwErrors and array_key_exists('errors', $result)) {
194
throw new \Exception(is_array($result['errors']) ? implode("\n", $result['errors']) : $result['errors']);
195
}
196
return $result;
0 commit comments