Enum fantoccini::error::CmdError[][src]

pub enum CmdError {
    Standard(WebDriverError),
    NoSuchElement(WebDriverError),
    NoSuchWindow(WebDriverError),
    BadUrl(ParseError),
    Failed(HError),
    Lost(IOError),
    NotJson(String),
    Json(Error),
    NotW3C(Value),
    InvalidArgument(StringString),
    ImageDecodeError(DecodeError),
}
Expand description

An error occurred while executing some browser action.

Variants

Standard(WebDriverError)

A standard WebDriver error occurred.

See the spec for details about what each of these errors represent. Note that for convenience NoSuchElement has been extracted into its own top-level variant.

NoSuchElement(WebDriverError)

No element was found matching the given locator.

This variant lifts the “no such element” error variant from Standard to simplify checking for it in user code.

It is also used for the “stale element reference” error variant.

NoSuchWindow(WebDriverError)

The requested window does not exist.

This variant lifts the “no such window” error variant from Standard to simplify checking for it in user code.

BadUrl(ParseError)

A bad URL was encountered during parsing.

This normally happens if a link is clicked or the current URL is requested, but the URL in question is invalid or otherwise malformed.

Failed(HError)

A request to the WebDriver server failed.

Lost(IOError)

The connection to the WebDriver server was lost.

NotJson(String)

The WebDriver server responded with a non-standard, non-JSON reply.

Json(Error)

The WebDriver server responded to a command with an invalid JSON response.

NotW3C(Value)

The WebDriver server produced a response that does not conform to the W3C WebDriver specification.

Note: if you are trying to use phantomjs or chromedriver, note that these WebDriver implementations do not conform to the spec at this time. For example, chromedriver does not place sessionId for NewSession or errors under the value key in responses, and does not correctly encode and decode WebElement references.

InvalidArgument(StringString)

A function was invoked with an invalid argument.

ImageDecodeError(DecodeError)

Could not decode a base64 image

Implementations

Returns true if this error indicates that a matching element was not found.

Equivalent to

let is_miss = if let CmdError::NoSuchElement(..) = e {
  true
} else {
  false
};

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.