diff --git a/src/Delivery/NovaPoshtaApi2.php b/src/Delivery/NovaPoshtaApi2.php index e1c2e91..015f887 100644 --- a/src/Delivery/NovaPoshtaApi2.php +++ b/src/Delivery/NovaPoshtaApi2.php @@ -192,7 +192,7 @@ private function prepare($data) ? $data : json_decode($data, true); // If error exists, throw Exception - if ($this->throwErrors and array_key_exists('errors', $result)) { + if ($this->throwErrors and array_key_exists('errors', $result) and $result['errors']) { throw new \Exception(is_array($result['errors']) ? implode("\n", $result['errors']) : $result['errors']); } return $result;