You are here

protected function RemotePostWebformHandler::responseHasError in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformHandler/RemotePostWebformHandler.php \Drupal\webform\Plugin\WebformHandler\RemotePostWebformHandler::responseHasError()

Determine if response has an error status code.

Parameters

\Psr\Http\Message\ResponseInterface|null $response: The response returned by the remote server.

Return value

bool TRUE if response status code reflects an unsuccessful value.

2 calls to RemotePostWebformHandler::responseHasError()
RemotePostWebformHandler::displayCustomResponseMessage in src/Plugin/WebformHandler/RemotePostWebformHandler.php
Display custom response message.
RemotePostWebformHandler::remotePost in src/Plugin/WebformHandler/RemotePostWebformHandler.php
Execute a remote post.

File

src/Plugin/WebformHandler/RemotePostWebformHandler.php, line 1157

Class

RemotePostWebformHandler
Webform submission remote post handler.

Namespace

Drupal\webform\Plugin\WebformHandler

Code

protected function responseHasError($response) {
  $status_code = $response
    ->getStatusCode();
  return $status_code < 200 || $status_code >= 300;
}