Package com.opera.core.systems.scope.exceptions

Examples of com.opera.core.systems.scope.exceptions.ScopeException


      // FIXME make generic
      Header header;
      try {
        header = Header.parseFrom(event.getPayload());
      } catch (InvalidProtocolBufferException e) {
        throw new ScopeException("Exception while parsing event", e);
      }
      eventHandler.onRequest(header.getWindowID());
    } else if (service.equals("core")) {
      switch (CoreMessage.get(eventId)) {
        case ON_ACTIVE:
View Full Code Here


  private GeneratedMessage.Builder<?> buildMessage(
      GeneratedMessage.Builder<?> builder, byte[] message) {
    try {
      return builder.mergeFrom(message);
    } catch (InvalidProtocolBufferException e) {
      throw new ScopeException(String.format("Could not build %s: %s",
                                             builder.getDescriptorForType().getFullName(),
                                             e.getMessage()), e);
    }
  }
View Full Code Here

    if (requiredVersion == null) {
      return;
    }

    if (!isVersionInRange(requiredVersion)) {
      throw new ScopeException(String.format(
          "Unmet version dependency for Scope service %s: Requested version %s, but only has " +
          "version %s", getServiceName(), requiredVersion, getServiceVersion()));
    }
  }
View Full Code Here

  private static GeneratedMessage.Builder<?> buildMessage(
      GeneratedMessage.Builder<?> builder, byte[] message) {
    try {
      return builder.mergeFrom(message);
    } catch (InvalidProtocolBufferException e) {
      throw new ScopeException(String.format("Could not build %s: %s",
                                             builder.getDescriptorForType().getFullName(),
                                             e.getMessage()));
    }
  }
View Full Code Here

            for (int i = 0; i < 5; i++) {
              if (bytes.get() >= 0) {
                return result;
              }
            }
            connectionHandler.onException(new ScopeException("Error while reading raw int"));
          }
        }
      }
    }
    return result;
View Full Code Here

        return number.longValue();
      } else {
        return number.doubleValue();
      }
    } catch (ParseException e) {
      throw new ScopeException("A number result from the script can not be parsed: " +
                               e.getMessage());
    }
  }
View Full Code Here

          break;
        case SITE_PREFS:
          clearFlags.add(CoreProtos.ClearFlags.CLEAR_SITE_PREFS);
          break;
        default:
          throw new ScopeException("Unhandled private data flag: " + flag);
      }
    }

    return clearFlags.build();
  }
View Full Code Here

    configuration.setStopAtGc(false);

    executeMessage(EcmascriptDebuggerMessage.SET_CONFIGURATION, configuration);

    if (!updateRuntime()) {
      throw new ScopeException("Could not find a runtime for script injection");
    }

    // TODO: Workaround for internal dialogue
    // The dialog is finally removed but just keeping this here
    // until every platform upgrades to core 2.7+
View Full Code Here

    }

    Response response = executeMessage(EcmascriptDebuggerMessage.EVAL, evalBuilder);

    if (response == null) {
      throw new ScopeException("Internal error while executing script");
    }

    EvalResult result = parseEvalData(response);

    Object parsed = parseEvalReply(result);
View Full Code Here

    if (!status.equals("completed")) {
      if (status.equals("unhandled-exception")) {
        // Would be great give the JS error here, but it appears that by the
        // time we callFunctionOnObject the error object has gone...
        throw new ScopeException("Ecmascript exception");
      } else if (status.equals("cancelled-by-scheduler")) {
        // TODO: what is the best approach here?
        return null;
      }
    }
View Full Code Here

TOP

Related Classes of com.opera.core.systems.scope.exceptions.ScopeException

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.