src/GovTribe/LaravelKinvey/Client/Exception/KinveyResponseExceptionFactory.php
protected function createException(RequestInterface $request, Response $response, array $parts)
	{
		$message = 'Status Code: ' . $response->getStatusCode() . PHP_EOL
			. 'Kinvey Request ID: ' . $parts['request_id'] . PHP_EOL
			. 'Kinvey Exception Type: ' . $parts['type'] . PHP_EOL
			. 'Kinvey Error Message: ' . $parts['description'] . PHP_EOL
			. 'Kinvey Debug: ' . $parts['debug'];

		$class = new KinveyResponseException($message);
		$class->setExceptionType($parts['type']);
		$class->setResponse($response);
		$class->setRequest($request);
		$class->setRequestId($parts['request_id']);
		$class->setDebug($parts['debug']);
		return $class;
	}
protected function createException(RequestInterface $request, Response $response, array $parts)
	{
		$message = 'Status Code: ' . $response->getStatusCode() . PHP_EOL
			. 'Kinvey Request ID: ' . $parts['request_id'] . PHP_EOL
			. 'Kinvey Exception Type: ' . $parts['type'] . PHP_EOL
			. 'Kinvey Error Message: ' . $parts['description'] . PHP_EOL
			. 'Kinvey Debug: ' . $parts['debug'];

		$class = new KinveyResponseException($message);
		$class->setExceptionType($parts['type']);
		$class->setResponse($response);
		$class->setRequest($request);
		$class->setRequestId($parts['request_id']);
		$class->setDebug($parts['debug']);
		return $class;
	}
protected function createException ( RequestInterface $ request , Response $ response , array $ parts ) { $ message = 'Status Code: ' . $ response -> getStatusCode ( ) . PHP_EOL . 'Kinvey Request ID: ' . $ parts [ 'request_id' ] . PHP_EOL . 'Kinvey Exception Type: ' . $ parts [ 'type' ] . PHP_EOL . 'Kinvey Error Message: ' . $ parts [ 'description' ] . PHP_EOL . 'Kinvey Debug: ' . $ parts [ 'debug' ] ; $ class = new KinveyResponseException ( $ message ) ; $ class -> setExceptionType ( $ parts [ 'type' ] ) ; $ class -> setResponse ( $ response ) ; $ class -> setRequest ( $ request ) ; $ class -> setRequestId ( $ parts [ 'request_id' ] ) ; $ class -> setDebug ( $ parts [ 'debug' ] ) ; return $ class ; }
Create an prepare an exception object

@param RequestInterface $request   Request
@param Response         $response  Response received
@param array            $parts     Parsed exception data

@return \Exception
Create an prepare an exception object