src/Bridge.php
public function failedRequest(Response $response)
    {
        // Decode Response.
        $decodedResponse = json_decode($response->getBody()->getContents(), true);
        // Get error message.
        $errorMessage = (isset($decodedResponse['error_message']) && ! is_null($decodedResponse['error_message'])) ? $decodedResponse['error_message'] : $response->getReasonPhrase();
        // ClientException.
        throw new WatsonBridgeException($errorMessage, $response->getStatusCode());
    }
public function failedRequest(Response $response)
    {
        // Decode Response.
        $decodedResponse = json_decode($response->getBody()->getContents(), true);
        // Get error message.
        $errorMessage = (isset($decodedResponse['error_message']) && ! is_null($decodedResponse['error_message'])) ? $decodedResponse['error_message'] : $response->getReasonPhrase();
        // ClientException.
        throw new WatsonBridgeException($errorMessage, $response->getStatusCode());
    }
public function failedRequest ( Response $ response ) { // Decode Response. $ decodedResponse = json_decode ( $ response -> getBody ( ) -> getContents ( ) , true ) ; // Get error message. $ errorMessage = ( isset ( $ decodedResponse [ 'error_message' ] ) && ! is_null ( $ decodedResponse [ 'error_message' ] ) ) ? $ decodedResponse [ 'error_message' ] : $ response -> getReasonPhrase ( ) ; // ClientException. throw new WatsonBridgeException ( $ errorMessage , $ response -> getStatusCode ( ) ) ; }
Failed Request to Watson.

@param Response $response

@throws WatsonBridgeException
Failed Request to Watson .