Skip to main content

AppError

Struct AppError 

Source
pub struct AppError {
    pub message: String,
    pub code: ExitCode,
    pub custom_json: Option<String>,
}

Fields§

§message: String§code: ExitCode§custom_json: Option<String>

Pre-serialized JSON to emit instead of the default ErrorOutput. Used by the JS execution path to preserve its richer error schema.

Implementations§

Source§

impl AppError

Source

pub fn not_implemented(command: &str) -> Self

Source

pub fn stale_session() -> Self

Source

pub fn no_session() -> Self

Source

pub fn target_not_found(tab: &str) -> Self

Source

pub fn no_page_targets() -> Self

Source

pub fn last_tab() -> Self

Source

pub fn navigation_failed(error_text: &str) -> Self

Source

pub fn navigation_timeout(timeout_ms: u64, strategy: &str) -> Self

Source

pub fn element_not_found(selector: &str) -> Self

Source

pub fn evaluation_failed(description: &str) -> Self

Source

pub fn snapshot_failed(description: &str) -> Self

Source

pub fn file_write_failed(path: &str, error: &str) -> Self

Source

pub fn screenshot_failed(description: &str) -> Self

Source

pub fn uid_not_found(uid: &str) -> Self

Source

pub fn invalid_clip(input: &str) -> Self

Source

pub fn no_active_trace() -> Self

Source

pub fn unknown_insight(name: &str) -> Self

Source

pub fn trace_file_not_found(path: &str) -> Self

Source

pub fn trace_parse_failed(error: &str) -> Self

Source

pub fn trace_timeout(timeout_ms: u64) -> Self

Source

pub fn js_execution_failed(description: &str) -> Self

Source

pub fn js_execution_failed_with_json(description: &str, json: String) -> Self

Source

pub fn script_file_not_found(path: &str) -> Self

Source

pub fn script_file_read_failed(path: &str, error: &str) -> Self

Source

pub fn no_js_code() -> Self

Source

pub fn no_dialog_open() -> Self

Source

pub fn dialog_handle_failed(reason: &str) -> Self

Source

pub fn no_chrome_found() -> Self

Source

pub fn chrome_terminated() -> Self

Unrecoverable connection loss: Chrome process is gone.

Emits a structured JSON error on stderr with kind = "chrome_terminated" and recoverable = false, suggesting agentchrome connect --launch.

Source

pub fn transient_connection_loss(detail: impl Into<String>) -> Self

Recoverable connection loss: probe failed but we cannot prove Chrome is gone. Emits kind = "transient", recoverable = true, and suggests agentchrome connect.

Source

pub fn no_snapshot_state() -> Self

Source

pub fn element_zero_size(target: &str) -> Self

Source

pub fn invalid_key(key: &str) -> Self

Source

pub fn duplicate_modifier(modifier: &str) -> Self

Source

pub fn interaction_failed(action: &str, reason: &str) -> Self

Source

pub fn emulation_failed(description: &str) -> Self

Source

pub fn invalid_viewport(input: &str) -> Self

Source

pub fn invalid_geolocation(input: &str) -> Self

Source

pub fn file_not_found(path: &str) -> Self

Source

pub fn file_not_readable(path: &str) -> Self

Source

pub fn not_file_input(target: &str) -> Self

Source

pub fn not_in_form(target: &str) -> Self

Source

pub fn node_not_found(id: &str) -> Self

Source

pub fn attribute_not_found(name: &str, node_id: &str) -> Self

Source

pub fn no_parent() -> Self

Source

pub fn element_target_not_found(target: &str) -> Self

Source

pub fn frame_not_found(index: u32) -> Self

Source

pub fn frame_path_invalid(path: &str, segment: u32, max_children: u32) -> Self

Source

pub fn frame_detached() -> Self

Source

pub fn element_not_in_any_frame() -> Self

Source

pub fn worker_not_found(index: u32) -> Self

Source

pub fn css_selector_not_found(selector: &str) -> Self

Source

pub fn stale_uid(uid: &str) -> Self

Source

pub fn element_not_scrollable(descriptor: &str) -> Self

Source

pub fn js_eval_error(js_message: &str) -> Self

Source

pub fn form_fill_not_fillable( target: &str, tag: &str, role: Option<&str>, ) -> Self

Source

pub fn wait_timeout(timeout_ms: u64, condition: &str) -> Self

Source

pub fn to_json(&self) -> String

Source

pub fn print_json_stderr(&self)

Trait Implementations§

Source§

impl Debug for AppError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AppError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for AppError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CdpError> for AppError

Source§

fn from(e: CdpError) -> Self

Converts to this type from the input type.
Source§

impl From<ChromeError> for AppError

Source§

fn from(e: ChromeError) -> Self

Converts to this type from the input type.
Source§

impl From<ConfigError> for AppError

Source§

fn from(e: ConfigError) -> Self

Converts to this type from the input type.
Source§

impl From<SessionError> for AppError

Source§

fn from(e: SessionError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V