@Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { UpdateProcessor updateProcessor = uef.createUpdateProcessor(updateRequest); try { updateProcessor.execute(); } catch(Exception e) { if(e instanceof HttpException) { HttpException x = (HttpException)e; logger.debug(x.getResponse()); } throw e; } return RepeatStatus.FINISHED; } }
@Override public void write(List<? extends Entry<? extends Node, ? extends Diff<? extends DatasetGraph>>> items) throws Exception { List<Diff<? extends DatasetGraph>> diffs = Lists.newArrayList(); for(Entry<? extends Node, ? extends Diff<? extends DatasetGraph>> item : items) { Diff<? extends DatasetGraph> diff = item.getValue(); diffs.add(diff); } Diff<DatasetGraph> diff = UpdateDiffUtils.combineDatasetGraph(diffs); try { UpdateExecutionUtils.executeUpdateDatasetGraph(uef, diff); } catch(Exception e) { if(e instanceof HttpException) { HttpException x = (HttpException)e; String response = x.getResponse(); throw new RuntimeException(response, e); } } }
public QueryExceptionHTTP(int responseCode, String message, final HttpException ex) { this(responseCode, message, ex.getCause()); this.statusLine = ex.getStatusLine(); this.response = ex.getResponse(); }
public static RuntimeException makeHumanFriendly(Exception e) { RuntimeException result; if(e instanceof HttpException) { HttpException x = (HttpException)e; result = new HttpException(x.getResponse(), e); } else if(e instanceof QueryExceptionHTTP) { QueryExceptionHTTP x = (QueryExceptionHTTP)e; result = new QueryExceptionHTTP(x.getResponseMessage() + " " + x.getMessage(), e); } else { result = new RuntimeException(e); } return result; } }