public function onComplete(CompleteEvent $event)
    {
        $json = $event->getResponse()->json();

        if (array_get($json, 'result') !== 'success' || array_key_exists('response', $json) === false) {
            throw RequestException::create($event->getRequest(), $event->getResponse());
        }
    }
public function onComplete(CompleteEvent $event)
    {
        $json = $event->getResponse()->json();

        if (array_get($json, 'result') !== 'success' || array_key_exists('response', $json) === false) {
            throw RequestException::create($event->getRequest(), $event->getResponse());
        }
    }
public function onComplete ( CompleteEvent $ event ) { $ json = $ event -> getResponse ( ) -> json ( ) ; if ( array_get ( $ json , 'result' ) !== 'success' || array_key_exists ( 'response' , $ json ) === false ) { throw RequestException :: create ( $ event -> getRequest ( ) , $ event -> getResponse ( ) ) ; } }
Throw a RequestException if the response is not marked as successful.

@param \GuzzleHttp\Event\CompleteEvent $event

@throws \GuzzleHttp\Exception\RequestException

@return void
Throw a RequestException if the response is not marked as successful .