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; }
@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)); } });
private static ResponseError fallbackResponseError(String header, Throwable throwable) { LOG.log(Level.SEVERE, header + ": " + throwable.getMessage(), throwable); ResponseError error = new ResponseError(); error.setMessage(header + "."); error.setCode(ResponseErrorCode.InternalError); ByteArrayOutputStream stackTrace = new ByteArrayOutputStream(); PrintWriter stackTraceWriter = new PrintWriter(stackTrace); throwable.printStackTrace(stackTraceWriter); stackTraceWriter.flush(); error.setData(stackTrace.toString()); return error; }
private static ResponseError fallbackResponseError(String header, Throwable throwable) { LOG.log(Level.SEVERE, header + ": " + throwable.getMessage(), throwable); ResponseError error = new ResponseError(); error.setMessage(header + "."); error.setCode(ResponseErrorCode.InternalError); ByteArrayOutputStream stackTrace = new ByteArrayOutputStream(); PrintWriter stackTraceWriter = new PrintWriter(stackTrace); throwable.printStackTrace(stackTraceWriter); stackTraceWriter.flush(); error.setData(stackTrace.toString()); return error; }
ResponseError error = new ResponseError(ResponseErrorCode.MethodNotFound, message, null); exceptionalResult.completeExceptionally(new ResponseErrorException(error)); return exceptionalResult;
ResponseError error = new ResponseError(ResponseErrorCode.MethodNotFound, message, null); exceptionalResult.completeExceptionally(new ResponseErrorException(error)); return exceptionalResult;
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));
if (isCancellation(t)) { String message = "The request (id: " + messageId + ", method: '" + requestMessage.getMethod() + "') has been cancelled"; ResponseError errorObject = new ResponseError(ResponseErrorCode.RequestCancelled, message, null); responseMessage = createErrorResponseMessage(requestMessage, errorObject); } else {
if (isCancellation(t)) { String message = "The request (id: " + messageId + ", method: '" + requestMessage.getMethod() + "') has been cancelled"; ResponseError errorObject = new ResponseError(ResponseErrorCode.RequestCancelled, message, null); responseMessage = createErrorResponseMessage(requestMessage, errorObject); } else {
protected void handleRequestIssues(RequestMessage requestMessage, List<MessageIssue> issues) { ResponseError errorObject = new ResponseError(); if (issues.size() == 1) { MessageIssue issue = issues.get(0); errorObject.setMessage(issue.getText()); errorObject.setCode(issue.getIssueCode()); errorObject.setData(issue.getCause()); } else { if (requestMessage.getMethod() != null) errorObject.setMessage("Multiple issues were found in '" + requestMessage.getMethod() + "' request."); else errorObject.setMessage("Multiple issues were found in request."); errorObject.setCode(ResponseErrorCode.InvalidRequest); errorObject.setData(issues); } out.consume(createErrorResponseMessage(requestMessage, errorObject)); }
protected void handleRequestIssues(RequestMessage requestMessage, List<MessageIssue> issues) { ResponseError errorObject = new ResponseError(); if (issues.size() == 1) { MessageIssue issue = issues.get(0); errorObject.setMessage(issue.getText()); errorObject.setCode(issue.getIssueCode()); errorObject.setData(issue.getCause()); } else { if (requestMessage.getMethod() != null) errorObject.setMessage("Multiple issues were found in '" + requestMessage.getMethod() + "' request."); else errorObject.setMessage("Multiple issues were found in request."); errorObject.setCode(ResponseErrorCode.InvalidRequest); errorObject.setData(issues); } out.consume(createErrorResponseMessage(requestMessage, errorObject)); }
create.run(monitor); if (check.getStatus().getSeverity() >= RefactoringStatus.FATAL) { throw new ResponseErrorException(new ResponseError(ResponseErrorCode.InvalidRequest, check.getStatus().getMessageMatchingSeverity(RefactoringStatus.ERROR), null));
message.setMethod(method); if (!success) { ResponseError error = new ResponseError(); error.setCode(ResponseErrorCode.UnknownErrorCode); error.setData(body);
throw new ResponseErrorException(new ResponseError(ResponseErrorCode.InvalidRequest, "Renaming this element is not supported.", null));
ResponseError _responseError = new ResponseError(); final Procedure1<ResponseError> _function = (ResponseError it) -> { String _switchResult = null;
it.setJsonrpc("2.0"); it.setId("12"); ResponseError _responseError = new ResponseError(); final Procedure1<ResponseError> _function_1 = (ResponseError it_1) -> { it_1.setCode(ResponseErrorCode.InvalidRequest);
it.setJsonrpc("2.0"); it.setId("12"); ResponseError _responseError = new ResponseError(); final Procedure1<ResponseError> _function_2 = (ResponseError it_1) -> { it_1.setCode(ResponseErrorCode.InvalidRequest);