protected void parseAuthenticationResponse(JsonObject jsonRet) throws RestApiConnectionException { if (!hasId(jsonRet)) { throw new RestApiConnectionException("Failed on authentication with the following HTTP response received:" + jsonRet.toString()); } this.instanceUrl = jsonRet.get("instance_url").getAsString(); this.accessToken = jsonRet.get("access_token").getAsString(); this.createdAt = System.currentTimeMillis(); } }
log.error("content length: " + httpEntity.getContentLength()); log.error("content: " + IOUtils.toString(httpEntity.getContent(), Charsets.UTF_8)); throw new RestApiConnectionException( "JSON is NULL ! Failed on authentication with the following HTTP response received:\n" + EntityUtils.toString(httpEntity)); throw new RestApiConnectionException("Failed to get rest api connection; error - " + e.getMessage(), e); } finally { if (httpEntity != null) { EntityUtils.consume(httpEntity); } catch (IOException e) { throw new RestApiConnectionException("Failed to consume httpEntity; error - " + e.getMessage(), e);
throw new RestApiConnectionException("Failed to authenticate salesforce host:" + host + "; error-" + e.getMessage(), e);
protected void parseAuthenticationResponse(JsonObject jsonRet) throws RestApiConnectionException { if (!hasId(jsonRet)) { throw new RestApiConnectionException("Failed on authentication with the following HTTP response received:" + jsonRet.toString()); } this.instanceUrl = jsonRet.get("instance_url").getAsString(); this.accessToken = jsonRet.get("access_token").getAsString(); this.createdAt = System.currentTimeMillis(); } }
log.error("content length: " + httpEntity.getContentLength()); log.error("content: " + IOUtils.toString(httpEntity.getContent(), Charsets.UTF_8)); throw new RestApiConnectionException( "JSON is NULL ! Failed on authentication with the following HTTP response received:\n" + EntityUtils.toString(httpEntity)); throw new RestApiConnectionException("Failed to get rest api connection; error - " + e.getMessage(), e); } finally { if (httpEntity != null) { EntityUtils.consume(httpEntity); } catch (IOException e) { throw new RestApiConnectionException("Failed to consume httpEntity; error - " + e.getMessage(), e);