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
impl AppError
pub fn not_implemented(command: &str) -> Self
pub fn stale_session() -> Self
pub fn no_session() -> Self
pub fn target_not_found(tab: &str) -> Self
pub fn no_page_targets() -> Self
pub fn last_tab() -> Self
pub fn element_not_found(selector: &str) -> Self
pub fn evaluation_failed(description: &str) -> Self
pub fn snapshot_failed(description: &str) -> Self
pub fn file_write_failed(path: &str, error: &str) -> Self
pub fn screenshot_failed(description: &str) -> Self
pub fn uid_not_found(uid: &str) -> Self
pub fn invalid_clip(input: &str) -> Self
pub fn no_active_trace() -> Self
pub fn unknown_insight(name: &str) -> Self
pub fn trace_file_not_found(path: &str) -> Self
pub fn trace_parse_failed(error: &str) -> Self
pub fn trace_timeout(timeout_ms: u64) -> Self
pub fn js_execution_failed(description: &str) -> Self
pub fn js_execution_failed_with_json(description: &str, json: String) -> Self
pub fn script_file_not_found(path: &str) -> Self
pub fn script_file_read_failed(path: &str, error: &str) -> Self
pub fn no_js_code() -> Self
pub fn no_dialog_open() -> Self
pub fn dialog_handle_failed(reason: &str) -> Self
pub fn no_chrome_found() -> Self
Sourcepub fn chrome_terminated() -> Self
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.
Sourcepub fn transient_connection_loss(detail: impl Into<String>) -> Self
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.
pub fn no_snapshot_state() -> Self
pub fn element_zero_size(target: &str) -> Self
pub fn invalid_key(key: &str) -> Self
pub fn duplicate_modifier(modifier: &str) -> Self
pub fn interaction_failed(action: &str, reason: &str) -> Self
pub fn emulation_failed(description: &str) -> Self
pub fn invalid_viewport(input: &str) -> Self
pub fn invalid_geolocation(input: &str) -> Self
pub fn file_not_found(path: &str) -> Self
pub fn file_not_readable(path: &str) -> Self
pub fn not_file_input(target: &str) -> Self
pub fn not_in_form(target: &str) -> Self
pub fn node_not_found(id: &str) -> Self
pub fn attribute_not_found(name: &str, node_id: &str) -> Self
pub fn no_parent() -> Self
pub fn element_target_not_found(target: &str) -> Self
pub fn frame_not_found(index: u32) -> Self
pub fn frame_path_invalid(path: &str, segment: u32, max_children: u32) -> Self
pub fn frame_detached() -> Self
pub fn element_not_in_any_frame() -> Self
pub fn worker_not_found(index: u32) -> Self
pub fn css_selector_not_found(selector: &str) -> Self
pub fn stale_uid(uid: &str) -> Self
pub fn element_not_scrollable(descriptor: &str) -> Self
pub fn js_eval_error(js_message: &str) -> Self
pub fn form_fill_not_fillable( target: &str, tag: &str, role: Option<&str>, ) -> Self
pub fn wait_timeout(timeout_ms: u64, condition: &str) -> Self
pub fn to_json(&self) -> String
pub fn print_json_stderr(&self)
Trait Implementations§
Source§impl Error for AppError
impl Error for AppError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ChromeError> for AppError
impl From<ChromeError> for AppError
Source§fn from(e: ChromeError) -> Self
fn from(e: ChromeError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigError> for AppError
impl From<ConfigError> for AppError
Source§fn from(e: ConfigError) -> Self
fn from(e: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<SessionError> for AppError
impl From<SessionError> for AppError
Source§fn from(e: SessionError) -> Self
fn from(e: SessionError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AppError
impl RefUnwindSafe for AppError
impl Send for AppError
impl Sync for AppError
impl Unpin for AppError
impl UnsafeUnpin for AppError
impl UnwindSafe for AppError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more