congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
JavaScriptException
Code IndexAdd Tabnine to your IDE (free)

How to use
JavaScriptException
in
com.google.gwt.core.client

Best Java code snippets using com.google.gwt.core.client.JavaScriptException (Showing top 20 results out of 315)

origin: com.google.gwt/gwt-servlet

 private void setHeaders(XMLHttpRequest xmlHttpRequest)
   throws RequestException {
  if (headers != null && headers.size() > 0) {
   for (Map.Entry<String, String> header : headers.entrySet()) {
    try {
     xmlHttpRequest.setRequestHeader(header.getKey(), header.getValue());
    } catch (JavaScriptException e) {
     throw new RequestException(e.getMessage());
    }
   }
  } else {
   xmlHttpRequest.setRequestHeader("Content-Type",
     "text/plain; charset=utf-8");
  }
 }
}
origin: com.google.gwt/gwt-servlet

private void ensureInit() {
 if (message == null) {
  Object exception = getThrown();
  name = getExceptionName(exception);
  description = description + ": " + getExceptionDescription(exception);
  message = "(" + name + ") " + description;
 }
}
origin: com.google.gwt/gwt-servlet

@Override
public String getMessage() {
 ensureInit();
 return message;
}
origin: org.codehaus.sonar/sonar-gwt-api

public static int getArraySize(JSONValue array) {
 if (array instanceof JSONArray) {
  return ((JSONArray) array).size();
 }
 if (array instanceof JSONObject) {
  return ((JSONObject) array).size();
 }
 throw new JavaScriptException("Not implemented");
}
origin: com.google.gwt/gwt-servlet

private static native void reportToBrowser(Object e) /*-{
 $wnd.setTimeout(function () {
  throw e;
 }, 0);
}-*/;
origin: threerings/playn

 throw e;
} else {
 JavaScriptException materialized = new JavaScriptException(e.getName(),
   e.getDescription());
 materialized.setStackTrace(e.getStackTrace());
 throw materialized;
origin: JetBrains/mapper

private void doExecute(Runnable r) {
 try {
  r.run();
 } catch (JavaScriptException jse) {
  if (jse.isThrownSet()) {
   LOG.severe("Caught JavaScriptException, wrapped error is: " + jse.getThrown());
  }
  ThrowableHandlers.handle(jse);
 } catch (Throwable t) {
  ThrowableHandlers.handle(t);
 }
}
origin: com.google.gwt/gwt-servlet

private static String getExceptionName(Object e) {
 if (e == null) {
  return "null";
 } else if (e instanceof JavaScriptObject) {
  return getExceptionName0((JavaScriptObject) e);
 } else if (e instanceof String) {
  return "String";
 } else {
  return e.getClass().getName();
 }
}
origin: com.google.gwt/gwt-servlet

private static String getExceptionDescription(Object e) {
 if (e instanceof JavaScriptObject) {
  return getExceptionDescription0((JavaScriptObject) e);
 } else {
  return e + "";
 }
}
origin: com.allen-sauer.gwt.log/gwt-log

static JavaScriptException convertJavaScriptObjectToException(JavaScriptObject e) {
 return new JavaScriptException(javaScriptExceptionName(e), javaScriptExceptionDescription(e));
}
origin: com.google.web.bindery/requestfactory-server

private static native void reportToBrowser(Object e) /*-{
 $wnd.setTimeout(function () {
  throw e;
 }, 0);
}-*/;
origin: net.wetheinter/gwt-user

private static String getExceptionName(Object e) {
 if (e == null) {
  return "null";
 } else if (e instanceof JavaScriptObject) {
  return getExceptionName0((JavaScriptObject) e);
 } else if (e instanceof String) {
  return "String";
 } else {
  return e.getClass().getName();
 }
}
origin: com.google.web.bindery/requestfactory-server

private static String getExceptionDescription(Object e) {
 if (e instanceof JavaScriptObject) {
  return getExceptionDescription0((JavaScriptObject) e);
 } else {
  return e + "";
 }
}
origin: com.google.gwt/gwt-servlet

 RequestPermissionException requestPermissionException = new RequestPermissionException(
   url);
 requestPermissionException.initCause(new RequestException(e.getMessage()));
 throw requestPermissionException;
 xmlHttpRequest.send(requestData);
} catch (JavaScriptException e) {
 throw new RequestException(e.getMessage());
origin: com.vaadin.external.gwt/gwt-user

private void ensureInit() {
 if (message == null) {
  Object exception = getThrown();
  name = getExceptionName(exception);
  description = description + ": " + getExceptionDescription(exception);
  message = "(" + name + ") " + description;
 }
}
origin: org.vectomatic/lib-gwt-svg

  public OMSVGICCColor iccColor(String str) {
//        GWT.log("iccColor(" + str + ")");
    ICC.setLastIndex(0);
    MatchResult result = ICC.exec(str);
    if (result != null && result.getGroupCount() == 3) {
      String[] intArray = result.getGroup(2).split(COMMA);
      List<Integer> intList = new ArrayList<Integer>();
      for (int i = 0; i < intArray.length; i++) {
        if (intArray[i].length() > 0) {
          intList.add(Integer.parseInt(intArray[i]));
        }
      }
      return new OMSVGICCColor(result.getGroup(1), intList);
    }
    throw new JavaScriptException("Invalid icc-color spec: " + str);
  }

origin: com.google.gwt/gwt-servlet

/**
 * Returns the original JavaScript message of the exception; may be
 * <code>null</code>.
 */
public String getDescription() {
 ensureInit();
 return description;
}
origin: net.wetheinter/gwt-user

private static native void reportToBrowser(Object e) /*-{
 $wnd.setTimeout(function () {
  throw e;
 }, 0);
}-*/;
origin: com.google.web.bindery/requestfactory-server

private static String getExceptionName(Object e) {
 if (e == null) {
  return "null";
 } else if (e instanceof JavaScriptObject) {
  return getExceptionName0((JavaScriptObject) e);
 } else if (e instanceof String) {
  return "String";
 } else {
  return e.getClass().getName();
 }
}
origin: com.vaadin.external.gwt/gwt-user

private static String getExceptionDescription(Object e) {
 if (e instanceof JavaScriptObject) {
  return getExceptionDescription0((JavaScriptObject) e);
 } else {
  return e + "";
 }
}
com.google.gwt.core.clientJavaScriptException

Javadoc

Any JavaScript exceptions occurring within JSNI methods are wrapped as this class when caught in Java code. The wrapping does not occur until the exception passes out of JSNI into Java. Before that, the thrown object remains a native JavaScript exception object, and can be caught in JSNI as normal.

The return value of #getStackTrace() may vary between browsers due to variations in the underlying error-reporting capabilities. When possible, the stack trace will be the stack trace of the underlying error object. If it is not possible to accurately report a stack trace, a zero-length array will be returned. In those cases where the underlying stack trace cannot be determined, #fillInStackTrace() can be called in the associated catch block to create a stack trace corresponding to the location where the JavaScriptException object was created.

 
try { 
nativeMethod(); 
} catch (JavaScriptException e) { 
if (e.getStackTrace().length == 0) { 
e.fillInStackTrace(); 
} 
} 

Most used methods

  • getMessage
  • getThrown
    Returns the original thrown object from javascript; may be null.
  • <init>
  • ensureInit
  • getExceptionDescription
  • getExceptionDescription0
  • getExceptionName
  • getExceptionName0
  • fillInStackTrace
  • getDescription
    Returns the original JavaScript message of the exception; may benull.
  • getName
    Returns the original JavaScript type name of the exception; may benull.
  • getStackTrace
  • getName,
  • getStackTrace,
  • isThrownSet,
  • setStackTrace

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now