protected function send()
    {
        $this->logger->info(sprintf('Submitting to %s', Jobs::URL));

        try {
            $response = $this->api->send();
            $message = $response
                ? sprintf('Finish submitting. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase())
                : 'Finish dry run';

            $this->logger->info($message);

            if ($response instanceof Response) {
                $this->logResponse($response);
            }

            return true;
        } catch (\GuzzleHttp\Exception\ConnectException $e) {
            // connection error
            $message = sprintf("Connection error occurred. %s\n\n%s", $e->getMessage(), $e->getTraceAsString());
        } catch (\GuzzleHttp\Exception\ClientException $e) {
            // 422 Unprocessable Entity
            $response = $e->getResponse();
            $message = sprintf('Client error occurred. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase());
        } catch (\GuzzleHttp\Exception\ServerException $e) {
            // 500 Internal Server Error
            // 503 Service Unavailable
            $response = $e->getResponse();
            $message = sprintf('Server error occurred. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase());
        }

        $this->logger->error($message);

        if (isset($response)) {
            $this->logResponse($response);
        }

        return false;
    }
protected function send()
    {
        $this->logger->info(sprintf('Submitting to %s', Jobs::URL));

        try {
            $response = $this->api->send();
            $message = $response
                ? sprintf('Finish submitting. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase())
                : 'Finish dry run';

            $this->logger->info($message);

            if ($response instanceof Response) {
                $this->logResponse($response);
            }

            return true;
        } catch (\GuzzleHttp\Exception\ConnectException $e) {
            // connection error
            $message = sprintf("Connection error occurred. %s\n\n%s", $e->getMessage(), $e->getTraceAsString());
        } catch (\GuzzleHttp\Exception\ClientException $e) {
            // 422 Unprocessable Entity
            $response = $e->getResponse();
            $message = sprintf('Client error occurred. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase());
        } catch (\GuzzleHttp\Exception\ServerException $e) {
            // 500 Internal Server Error
            // 503 Service Unavailable
            $response = $e->getResponse();
            $message = sprintf('Server error occurred. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase());
        }

        $this->logger->error($message);

        if (isset($response)) {
            $this->logResponse($response);
        }

        return false;
    }
protected function send ( ) { $ this -> logger -> info ( sprintf ( 'Submitting to %s' , Jobs :: URL ) ) ; try { $ response = $ this -> api -> send ( ) ; $ message = $ response ? sprintf ( 'Finish submitting. status: %s %s' , $ response -> getStatusCode ( ) , $ response -> getReasonPhrase ( ) ) : 'Finish dry run' ; $ this -> logger -> info ( $ message ) ; if ( $ response instanceof Response ) { $ this -> logResponse ( $ response ) ; } return true ; } catch ( \ GuzzleHttp \ Exception \ ConnectException $ e ) { // connection error $ message = sprintf ( "Connection error occurred. %s\n\n%s" , $ e -> getMessage ( ) , $ e -> getTraceAsString ( ) ) ; } catch ( \ GuzzleHttp \ Exception \ ClientException $ e ) { // 422 Unprocessable Entity $ response = $ e -> getResponse ( ) ; $ message = sprintf ( 'Client error occurred. status: %s %s' , $ response -> getStatusCode ( ) , $ response -> getReasonPhrase ( ) ) ; } catch ( \ GuzzleHttp \ Exception \ ServerException $ e ) { // 500 Internal Server Error // 503 Service Unavailable $ response = $ e -> getResponse ( ) ; $ message = sprintf ( 'Server error occurred. status: %s %s' , $ response -> getStatusCode ( ) , $ response -> getReasonPhrase ( ) ) ; } $ this -> logger -> error ( $ message ) ; if ( isset ( $ response ) ) { $ this -> logResponse ( $ response ) ; } return false ; }
Send json_file to Jobs API.

@return bool
Send json_file to Jobs API .