public final class WebErrorEvent
extends Event
WebEngine
error.
Holds an optional text message and an optional exception
associated with the error.WebEngine.onError
Modifier and Type | Field and Description |
---|---|
static <any> |
ANY
Common supertype for all
WebErrorEvent types. |
private java.lang.Throwable |
exception |
private java.lang.String |
message |
static <any> |
USER_DATA_DIRECTORY_ALREADY_IN_USE
This event occurs when a
WebEngine detects that its
user data directory is already in use by a WebEngine
running in a different VM. |
static <any> |
USER_DATA_DIRECTORY_IO_ERROR
This event occurs when a
WebEngine encounters
an I/O error while trying to create or access the user
data directory. |
static <any> |
USER_DATA_DIRECTORY_SECURITY_ERROR
This event occurs when a
WebEngine encounters
a security error while trying to create or access the user
data directory. |
Constructor and Description |
---|
WebErrorEvent(java.lang.Object source,
<any> type,
java.lang.String message,
java.lang.Throwable exception)
Creates a new
WebErrorEvent . |
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getException()
Returns the exception associated with this event.
|
java.lang.String |
getMessage()
Returns the text message associated with this event.
|
java.lang.String |
toString() |
public static final <any> ANY
WebErrorEvent
types.public static final <any> USER_DATA_DIRECTORY_ALREADY_IN_USE
WebEngine
detects that its
user data directory is already in use by a WebEngine
running in a different VM.
In general, multiple WebEngine
instances may share
a single user data directory as long as they run in the same
VM. WebEngine
instances running in different VMs are
not allowed to share the same user data directory.
When a WebEngine
is about to start loading a web
page or executing a script for the first time, it checks whether
its userDataDirectory
is already in use by a WebEngine
running in a different
VM. If the latter is the case, the WebEngine
invokes the
WebEngine.onError
event handler,
if any, with a USER_DATA_DIRECTORY_ALREADY_IN_USE
event.
If the invoked event handler modifies the userDataDirectory
property, the WebEngine
retries with the new user
data directory as soon as the handler returns. If the handler
does not modify the userDataDirectory
property (which
is the default), the WebEngine
continues without the
user data directory.
public static final <any> USER_DATA_DIRECTORY_IO_ERROR
WebEngine
encounters
an I/O error while trying to create or access the user
data directory.
When a WebEngine
is about to start loading a web
page or executing a script for the first time, it checks whether
it can create or access its
userDataDirectory
.
If the check fails with an I/O error (such as java.io.IOException
), the WebEngine
invokes the WebEngine.onError
event handler,
if any, with a USER_DATA_DIRECTORY_IO_ERROR
event.
If the invoked event handler modifies the userDataDirectory
property, the WebEngine
retries with the new user
data directory as soon as the handler returns. If the handler
does not modify the userDataDirectory
property (which
is the default), the WebEngine
continues without the
user data directory.
public static final <any> USER_DATA_DIRECTORY_SECURITY_ERROR
WebEngine
encounters
a security error while trying to create or access the user
data directory.
When a WebEngine
is about to start loading a web
page or executing a script for the first time, it checks whether
it can create or access its
userDataDirectory
.
If the check fails with a security error (such as java.lang.SecurityException
), the WebEngine
invokes the
WebEngine.onError
event handler,
if any, with a USER_DATA_DIRECTORY_SECURITY_ERROR
event.
If the invoked event handler modifies the userDataDirectory
property, the WebEngine
retries with the new user
data directory as soon as the handler returns. If the handler
does not modify the userDataDirectory
property (which
is the default), the WebEngine
continues without the
user data directory.
private final java.lang.String message
private final java.lang.Throwable exception
public WebErrorEvent(java.lang.Object source, <any> type, java.lang.String message, java.lang.Throwable exception)
WebErrorEvent
.source
- the event source which sent the eventtype
- the event typemessage
- the text message associated with the event;
may be null
exception
- the exception associated with the event;
may be null
public java.lang.String getMessage()
null
if there is no such messagepublic java.lang.Throwable getException()
null
if there is no such exceptionpublic java.lang.String toString()