Skip to content

Commit 545d4d2

Browse files
author
Armando Caprio
committed
Aggiornato controllo http status code
1 parent 54fc17e commit 545d4d2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ vendor/
22
composer.lock
33
.DS_Store
44
nbproject/*
5-
.idea
5+
.idea
6+
composer.phar

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function curl( string $verb, string $request, JsonSerializable $json = n
124124
throw new RequestFailureException( sprintf( 'Curl "%s%s" was wrong: [%s] %s', $this->Endpoint, $request, $curlErrorNumber, $curlErrorMessage ) );
125125
}
126126

127-
if ( $httpStatusCode != 200 ) {
127+
if ( !in_array($httpStatusCode, [200, 201, 204]) ) {
128128
$errorMessage = new ErrorMessage( $result );
129129
$exception = new RequestFailureException( sprintf( 'Http request "%s%s" was wrong. Code [%s] Message "%s"', $this->Endpoint, $request, $errorMessage->code, $errorMessage->message ) );
130130
$exception->setResponse( $errorMessage );

0 commit comments

Comments
 (0)