protected IWorkspaceConfig getWorkspaceConfig() { if ((this._workspaceConfig == null)) { final ResponseError error = new ResponseError(ResponseErrorCode.serverNotInitialized, "Workspace has not been initialized yet.", null); throw new ResponseErrorException(error); } return this._workspaceConfig; }
Assert.fail(); } catch (ExecutionException e) { Assert.assertNotNull(((ResponseErrorException)e.getCause()).getResponseError().getMessage()); Assert.fail(); } catch (ExecutionException e) { Assert.assertNotNull(((ResponseErrorException)e.getCause()).getResponseError().getMessage());
Assert.fail(); } catch (ExecutionException e) { Assert.assertNotNull(((ResponseErrorException)e.getCause()).getResponseError().getMessage()); Assert.fail(); } catch (ExecutionException e) { Assert.assertNotNull(((ResponseErrorException)e.getCause()).getResponseError().getMessage());
@Override public void handleException(Throwable ex) { IStatus status = new Status(IStatus.ERROR, IConstants.PLUGIN_ID, IStatus.OK, "Error in calling delegate command handler", ex); JavaLanguageServerPlugin.log(status); if (ex instanceof ResponseErrorException) { throw (ResponseErrorException) ex; } throw new ResponseErrorException(new ResponseError(ResponseErrorCode.UnknownErrorCode, ex.getMessage(), ex)); } });
protected void handleResponse(ResponseMessage responseMessage) { PendingRequestInfo requestInfo; synchronized (sentRequestMap) { requestInfo = sentRequestMap.remove(responseMessage.getId()); } if (requestInfo == null) { // We have no pending request information that matches the id given in the response LOG.log(Level.WARNING, "Unmatched response message: " + responseMessage); } else if (responseMessage.getError() != null) { // The remote service has replied with an error requestInfo.future.completeExceptionally(new ResponseErrorException(responseMessage.getError())); } else { // The remote service has replied with a result object requestInfo.future.complete(responseMessage.getResult()); } }
protected void handleResponse(ResponseMessage responseMessage) { PendingRequestInfo requestInfo; synchronized (sentRequestMap) { requestInfo = sentRequestMap.remove(responseMessage.getId()); } if (requestInfo == null) { // We have no pending request information that matches the id given in the response LOG.log(Level.WARNING, "Unmatched response message: " + responseMessage); } else if (responseMessage.getError() != null) { // The remote service has replied with an error requestInfo.future.completeExceptionally(new ResponseErrorException(responseMessage.getError())); } else { // The remote service has replied with a result object requestInfo.future.complete(responseMessage.getResult()); } }
CompletableFuture<?> exceptionalResult = new CompletableFuture<Object>(); ResponseError error = new ResponseError(ResponseErrorCode.MethodNotFound, message, null); exceptionalResult.completeExceptionally(new ResponseErrorException(error)); return exceptionalResult;
CompletableFuture<?> exceptionalResult = new CompletableFuture<Object>(); ResponseError error = new ResponseError(ResponseErrorCode.MethodNotFound, message, null); exceptionalResult.completeExceptionally(new ResponseErrorException(error)); return exceptionalResult;
public void checkSeverity() { RefactoringIssueAcceptor.Severity _maximumSeverity = this.getMaximumSeverity(); boolean _lessThan = (_maximumSeverity.compareTo(RefactoringIssueAcceptor.Severity.WARNING) < 0); if (_lessThan) { ResponseError _responseError = this.toResponseError(); throw new ResponseErrorException(_responseError); } } }
String errorMessage = "The workspace/executeCommand has empty params or command"; JavaLanguageServerPlugin.logError(errorMessage); throw new ResponseErrorException(new ResponseError(ResponseErrorCode.InvalidParams, errorMessage, null)); throw new ResponseErrorException(new ResponseError(ResponseErrorCode.InternalError, ex.getMessage(), ex)); throw new ResponseErrorException(new ResponseError(ResponseErrorCode.MethodNotFound, String.format("No delegateCommandHandler for %s", params.getCommand()), null));
create.run(monitor); if (check.getStatus().getSeverity() >= RefactoringStatus.FATAL) { throw new ResponseErrorException(new ResponseError(ResponseErrorCode.InvalidRequest, check.getStatus().getMessageMatchingSeverity(RefactoringStatus.ERROR), null));
throw new ResponseErrorException(new ResponseError(ResponseErrorCode.InvalidRequest, "Renaming this element is not supported.", null));