protected function handleBody($body, int $flags)
    {
        if ($flags & Relay::PAYLOAD_ERROR && $flags & Relay::PAYLOAD_RAW) {
            throw new Exceptions\ServiceException("error '$body' on '{$this->relay}'");
        }

        if ($flags & Relay::PAYLOAD_RAW) {
            return $body;
        }

        return json_decode($body, true);
    }
protected function handleBody($body, int $flags)
    {
        if ($flags & Relay::PAYLOAD_ERROR && $flags & Relay::PAYLOAD_RAW) {
            throw new Exceptions\ServiceException("error '$body' on '{$this->relay}'");
        }

        if ($flags & Relay::PAYLOAD_RAW) {
            return $body;
        }

        return json_decode($body, true);
    }
protected function handleBody ( $ body , int $ flags ) { if ( $ flags & Relay :: PAYLOAD_ERROR && $ flags & Relay :: PAYLOAD_RAW ) { throw new Exceptions \ ServiceException ( "error '$body' on '{$this->relay}'" ) ; } if ( $ flags & Relay :: PAYLOAD_RAW ) { return $ body ; } return json_decode ( $ body , true ) ; }
Handle response body.

@param string $body
@param int    $flags

@return mixed

@throws Exceptions\ServiceException
Handle response body .