Package org.eclipse.debug.core

Examples of org.eclipse.debug.core.DebugException


    // It does if you use the editor pane.
    if (!verifyValue(expression)) {
      // setValue called, but verifyValue failed
      Status stat = new Status(Status.WARNING, PHPDebugPlugin.ID,
          PHPDebugCoreMessages.XDebug_DBGpVariable_0);
      throw new DebugException(stat);
      // DebugUIPlugin.errorDialog(Display.getDefault().getActiveShell(),
      // ActionMessages.AssignValueAction_2,
      // MessageFormat.format(ActionMessages.AssignValueAction_3, new
      // String[] {expression, name}), new StatusInfo(IStatus.ERROR,
      // ActionMessages.AssignValueAction_4)); //
    } else {
      // attempt to set the property
      if (((DBGpTarget) getDebugTarget()).setProperty(this, expression)) {
        value.setValue(expression);
        fireChangeEvent(DebugEvent.CONTENT);
      } else {
        // program under debug rejected value change
        throw new DebugException(new Status(IStatus.ERROR,
            PHPDebugPlugin.ID,
            DebugException.TARGET_REQUEST_FAILED,
            PHPDebugCoreMessages.XDebug_DBGpVariable_1, null));
      }
    }
View Full Code Here


        }
        requestURL = new URL(url);
      } catch (MalformedURLException e) {
        Logger.logException(e);
        String errorMessage = PHPDebugCoreMessages.Debugger_Unexpected_Error_1;
        throw new DebugException(new Status(IStatus.ERROR,
            PHPDebugPlugin.getID(),
            IPHPDebugConstants.INTERNAL_ERROR, errorMessage, e));
      }
    }

    final DebugException[] exception = new DebugException[1];
    final URL debugURL = requestURL;
    Display.getDefault().syncExec(new Runnable() {
      public void run() {
        try {
          int browserStyle = IWorkbenchBrowserSupport.LOCATION_BAR
              | IWorkbenchBrowserSupport.NAVIGATION_BAR
              | IWorkbenchBrowserSupport.STATUS;

          StringBuilder browserTitle = new StringBuilder(debugURL
              .getProtocol()).append("://").append( //$NON-NLS-1$
              debugURL.getHost());
          if (debugURL.getPort() != -1) {
            browserTitle.append(':').append(debugURL.getPort());
          }
          browserTitle.append(debugURL.getPath());

          IWorkbenchBrowserSupport browserSupport = PlatformUI
              .getWorkbench().getBrowserSupport();
          IWebBrowser browser = browserSupport.createBrowser(
              browserStyle, "PDTDebuggerBrowser", //$NON-NLS-1$
              browserTitle.toString(), browserTitle.toString());

          if (PHPDebugPlugin.DEBUG) {
            System.out.println("Opening URL in a browser: " //$NON-NLS-1$
                + debugURL.toString());
          }
          browser.openURL(debugURL);

        } catch (Throwable t) {
          Logger.logException("Error initializing the web browser.", //$NON-NLS-1$
              t);
          String errorMessage = PHPDebugCoreMessages.Debugger_Unexpected_Error_1;
          exception[0] = new DebugException(new Status(IStatus.ERROR,
              PHPDebugPlugin.getID(),
              IPHPDebugConstants.INTERNAL_ERROR, errorMessage, t));
        }
      }
    });
View Full Code Here

        String headerKey = urlConection.getHeaderFieldKey(1);
        if (headerKey == null) {
          Logger.log(Logger.WARNING,
              "No HeaderKey returned by server. Most likely not started"); //$NON-NLS-1$
          String errorMessage = PHPDebugCoreMessages.DebuggerConnection_Problem_1;
          throw new DebugException(new Status(IStatus.ERROR,
              PHPDebugPlugin.getID(),
              IPHPDebugConstants.INTERNAL_ERROR, errorMessage,
              null));
        }

        for (int i = 1; (headerKey = urlConection.getHeaderFieldKey(i)) != null; i++) {
          if (headerKey.equals("X-Zend-Debug-Server")) { //$NON-NLS-1$
            String headerValue = urlConection
                .getHeaderField(headerKey);
            if (!headerValue.equals("OK")) { //$NON-NLS-1$
              Logger.log(Logger.WARNING,
                  "Unexpected Header Value returned by Server. " //$NON-NLS-1$
                      + headerValue);
              String errorMessage = PHPDebugCoreMessages.DebuggerConnection_Problem_2
                  + " - " + headerValue; //$NON-NLS-1$
              throw new DebugException(new Status(IStatus.ERROR,
                  PHPDebugPlugin.getID(),
                  IPHPDebugConstants.INTERNAL_ERROR,
                  errorMessage, null));
            }
            break;
          }
        }

        InputStream inputStream = urlConection.getInputStream();
        while (inputStream.read() != -1) {
          // do nothing on the content returned by standard stream
        }
        inputStream.close();
      }
    } catch (UnknownHostException e) {
      Logger.logException("Unknown host: " + requestURL.getHost(), e); //$NON-NLS-1$
    } catch (ConnectException e) {
      Logger.logException("Unable to connect to URL " + requestURL, e); //$NON-NLS-1$
    } catch (IOException e) {
      Logger.logException("Unable to connect to URL " + requestURL, e); //$NON-NLS-1$
    } catch (Exception e) {
      Logger.logException(
          "Unexpected exception communicating with Web server", e); //$NON-NLS-1$
      String errorMessage = e.getMessage();
      throw new DebugException(new Status(IStatus.ERROR,
          PHPDebugPlugin.getID(), IPHPDebugConstants.INTERNAL_ERROR,
          errorMessage, e));
    }
  }
View Full Code Here

    }

    public static void log(Throwable t) {
        Throwable top = t;
        if ( t instanceof DebugException ) {
            DebugException de = (DebugException) t;
            IStatus status = de.getStatus();
            if ( status.getException() != null ) {
                top = status.getException();
            }
        }
        log( new Status( IStatus.ERROR,
View Full Code Here

    }

    public static void log(Throwable t) {
        Throwable top = t;
        if ( t instanceof DebugException ) {
            DebugException de = (DebugException) t;
            IStatus status = de.getStatus();
            if ( status.getException() != null ) {
                top = status.getException();
            }
        }
        log( new Status( IStatus.ERROR,
View Full Code Here

                String message = "";

                for ( int i = 0; i < errorMessages.length; i++ ) {
                    message += errorMessages[i] + "\n";
                }
                throw new DebugException(new Status(IStatus.ERROR,
                    DroolsEclipsePlugin.PLUGIN_ID, DroolsEclipsePlugin.INTERNAL_ERROR,
                    "Error when compiling snippet " + snippet + ": " + message, null));
            }
            fResult = null;
            fEvaluationEngine.evaluateExpression(compiledExpression,
View Full Code Here

        this.value = value;
    }

    @Override
    public void setValue(IValue value) throws DebugException {
        throw new DebugException(new Status(Status.ERROR, TeaVMEclipsePlugin.ID, "Can't set value"));
    }
View Full Code Here

        throw new DebugException(new Status(Status.ERROR, TeaVMEclipsePlugin.ID, "Can't set value"));
    }

    @Override
    public void setValue(String value) throws DebugException {
        throw new DebugException(new Status(Status.ERROR, TeaVMEclipsePlugin.ID, "Can't set value"));
    }
View Full Code Here

          try {
            lock.wait();
          } catch (InterruptedException e) {
            fireConditionHasRuntimeErrors(
                lineBreakpoint,
                new DebugException(
                    new Status(
                        IStatus.ERROR,
                        JDIDebugPlugin
                            .getUniqueIdentifier(),
                        JDIDebugBreakpointMessages.ConditionalBreakpointHandler_0,
                        e)));
            return SUSPEND;
          }
        }
        return listener.getVote();
      } catch (CoreException e) {
        DebugException de = null;
        if (e instanceof DebugException) {
          de = (DebugException) e;
        } else {
          de = new DebugException(e.getStatus());
        }
        fireConditionHasRuntimeErrors(lineBreakpoint, de);
      }
    }
    return SUSPEND;
View Full Code Here

        // indicates the user terminated the evaluation
        return SUSPEND;
      }
      JDIThread thread = (JDIThread) result.getThread();
      if (result.hasErrors()) {
        DebugException exception = result.getException();
        Throwable wrappedException = exception.getStatus()
            .getException();
        if (wrappedException instanceof VMDisconnectedException) {
          // VM terminated/disconnected during evaluation
          return DONT_SUSPEND;
        }
        fireConditionHasRuntimeErrors(fBreakpoint, exception);
        return SUSPEND;
      }
      try {
        IValue value = result.getValue();
        if (fBreakpoint.isConditionSuspendOnTrue()) {
          if (value instanceof IJavaPrimitiveValue) {
            // Suspend when the condition evaluates true
            IJavaPrimitiveValue javaValue = (IJavaPrimitiveValue) value;
            if (javaValue.getJavaType().getName()
                .equals("boolean")) { //$NON-NLS-1$
              if (javaValue.getBooleanValue()) {
                return SUSPEND;
              }
              return DONT_SUSPEND;
            }
          }
          IStatus status = new Status(
              IStatus.ERROR,
              JDIDebugPlugin.getUniqueIdentifier(),
              MessageFormat.format(JDIDebugBreakpointMessages.ConditionalBreakpointHandler_1, value.getReferenceTypeName()));
          // result was not boolean
          fireConditionHasRuntimeErrors(fBreakpoint, new DebugException(status));
          return SUSPEND;
        }
        IDebugTarget debugTarget = thread.getDebugTarget();
        IValue lastValue = fBreakpoint
            .setCurrentConditionValue(debugTarget, value);
View Full Code Here

TOP

Related Classes of org.eclipse.debug.core.DebugException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.