Class WebRequestError

Object
Throwable
Exception
org.mozilla.geckoview.WebRequestError
All Implemented Interfaces:
Serializable

@AnyThread public class WebRequestError extends Exception
WebRequestError is simply a container for error codes and categories used by GeckoSession.NavigationDelegate.onLoadError(GeckoSession, String, WebRequestError).
See Also:
  • Field Details

    • ERROR_CATEGORY_UNKNOWN

      public static final int ERROR_CATEGORY_UNKNOWN
      This is normally used for error codes that don't currently fit into any of the other categories.
      See Also:
    • ERROR_CATEGORY_SECURITY

      public static final int ERROR_CATEGORY_SECURITY
      This is used for error codes that relate to SSL certificate validation.
      See Also:
    • ERROR_CATEGORY_NETWORK

      public static final int ERROR_CATEGORY_NETWORK
      This is used for error codes relating to network problems.
      See Also:
    • ERROR_CATEGORY_CONTENT

      public static final int ERROR_CATEGORY_CONTENT
      This is used for error codes relating to invalid or corrupt web pages.
      See Also:
    • ERROR_CATEGORY_URI

      public static final int ERROR_CATEGORY_URI
      See Also:
    • ERROR_CATEGORY_PROXY

      public static final int ERROR_CATEGORY_PROXY
      See Also:
    • ERROR_CATEGORY_SAFEBROWSING

      public static final int ERROR_CATEGORY_SAFEBROWSING
      See Also:
    • ERROR_UNKNOWN

      public static final int ERROR_UNKNOWN
      An unknown error occurred
      See Also:
    • ERROR_SECURITY_SSL

      public static final int ERROR_SECURITY_SSL
      This is used for a variety of SSL negotiation problems.
      See Also:
    • ERROR_SECURITY_BAD_CERT

      public static final int ERROR_SECURITY_BAD_CERT
      This is used to indicate an untrusted or otherwise invalid SSL certificate.
      See Also:
    • ERROR_NET_INTERRUPT

      public static final int ERROR_NET_INTERRUPT
      The network connection was interrupted.
      See Also:
    • ERROR_NET_TIMEOUT

      public static final int ERROR_NET_TIMEOUT
      The network request timed out.
      See Also:
    • ERROR_CONNECTION_REFUSED

      public static final int ERROR_CONNECTION_REFUSED
      The network request was refused by the server.
      See Also:
    • ERROR_UNKNOWN_SOCKET_TYPE

      public static final int ERROR_UNKNOWN_SOCKET_TYPE
      The network request tried to use an unknown socket type.
      See Also:
    • ERROR_REDIRECT_LOOP

      public static final int ERROR_REDIRECT_LOOP
      A redirect loop was detected.
      See Also:
    • ERROR_OFFLINE

      public static final int ERROR_OFFLINE
      This device does not have a network connection.
      See Also:
    • ERROR_PORT_BLOCKED

      public static final int ERROR_PORT_BLOCKED
      The request tried to use a port that is blocked by either the OS or Gecko.
      See Also:
    • ERROR_NET_RESET

      public static final int ERROR_NET_RESET
      The connection was reset.
      See Also:
    • ERROR_HTTPS_ONLY

      public static final int ERROR_HTTPS_ONLY
      GeckoView could not connect to this website in HTTPS-only mode. Call document.reloadWithHttpsOnlyException() in the error page to temporarily disable HTTPS only mode for this request.

      See also GeckoSession.NavigationDelegate.onLoadError(org.mozilla.geckoview.GeckoSession, java.lang.String, org.mozilla.geckoview.WebRequestError)

      See Also:
    • ERROR_UNSAFE_CONTENT_TYPE

      public static final int ERROR_UNSAFE_CONTENT_TYPE
      A content type was returned which was deemed unsafe.
      See Also:
    • ERROR_CORRUPTED_CONTENT

      public static final int ERROR_CORRUPTED_CONTENT
      The content returned was corrupted.
      See Also:
    • ERROR_CONTENT_CRASHED

      public static final int ERROR_CONTENT_CRASHED
      The content process crashed.
      See Also:
    • ERROR_INVALID_CONTENT_ENCODING

      public static final int ERROR_INVALID_CONTENT_ENCODING
      The content has an invalid encoding.
      See Also:
    • ERROR_UNKNOWN_HOST

      public static final int ERROR_UNKNOWN_HOST
      The host could not be resolved.
      See Also:
    • ERROR_MALFORMED_URI

      public static final int ERROR_MALFORMED_URI
      An invalid URL was specified.
      See Also:
    • ERROR_UNKNOWN_PROTOCOL

      public static final int ERROR_UNKNOWN_PROTOCOL
      An unknown protocol was specified.
      See Also:
    • ERROR_FILE_NOT_FOUND

      public static final int ERROR_FILE_NOT_FOUND
      A file was not found (usually used for file:// URIs).
      See Also:
    • ERROR_FILE_ACCESS_DENIED

      public static final int ERROR_FILE_ACCESS_DENIED
      The OS blocked access to a file.
      See Also:
    • ERROR_DATA_URI_TOO_LONG

      public static final int ERROR_DATA_URI_TOO_LONG
      A data:// URI is too long to load at the top level.
      See Also:
    • ERROR_PROXY_CONNECTION_REFUSED

      public static final int ERROR_PROXY_CONNECTION_REFUSED
      The proxy server refused the connection.
      See Also:
    • ERROR_UNKNOWN_PROXY_HOST

      public static final int ERROR_UNKNOWN_PROXY_HOST
      The host name of the proxy server could not be resolved.
      See Also:
    • ERROR_SAFEBROWSING_MALWARE_URI

      public static final int ERROR_SAFEBROWSING_MALWARE_URI
      The requested URI was present in the "malware" blocklist.
      See Also:
    • ERROR_SAFEBROWSING_UNWANTED_URI

      public static final int ERROR_SAFEBROWSING_UNWANTED_URI
      The requested URI was present in the "unwanted" blocklist.
      See Also:
    • ERROR_SAFEBROWSING_HARMFUL_URI

      public static final int ERROR_SAFEBROWSING_HARMFUL_URI
      The requested URI was present in the "harmful" blocklist.
      See Also:
    • ERROR_SAFEBROWSING_PHISHING_URI

      public static final int ERROR_SAFEBROWSING_PHISHING_URI
      The requested URI was present in the "phishing" blocklist.
      See Also:
    • code

      public final int code
      The error code, e.g. ERROR_MALFORMED_URI.
    • category

      public final int category
      The error category, e.g. ERROR_CATEGORY_URI.
    • certificate

      @Nullable public final X509Certificate certificate
      The server certificate used. This can be useful if the error code is is e.g. ERROR_SECURITY_BAD_CERT.
  • Constructor Details

    • WebRequestError

      public WebRequestError(int code, int category)
      Construct a new WebRequestError with the specified code and category.
      Parameters:
      code - An error code, e.g. ERROR_MALFORMED_URI
      category - An error category, e.g. ERROR_CATEGORY_URI
    • WebRequestError

      public WebRequestError(int code, int category, X509Certificate certificate)
      Construct a new WebRequestError with the specified code and category.
      Parameters:
      code - An error code, e.g. ERROR_MALFORMED_URI
      category - An error category, e.g. ERROR_CATEGORY_URI
      certificate - The X509Certificate server certificate used, if applicable.
  • Method Details