browser-commander 0.19.0

Universal browser automation library that supports multiple browser engines with a unified API
Documentation
// @generated by scripts/generate-puppeteer-bindings.mjs from
// rust/protocol/puppeteer/api.json. Do not edit by hand.

#![allow(clippy::all, missing_docs, unused_imports, non_snake_case)]

use serde_json::Value;

use super::*;
use crate::puppeteer::bridge::{binary, remote_type, BridgeError, JsFunction, Remote};

remote_type!(
    /// Puppeteer's `ProtocolError` (puppeteer-core 25.12.0), a remote object
    /// served by `browser-commander serve --stdio`.
    ///
    /// Extends [`PuppeteerError`]; the inherited methods are repeated here.
    ProtocolError
);

impl ProtocolError {
    /// `ProtocolError.code`
    ///
    /// ```text
    /// get code(): number | undefined
    /// ```
    pub async fn code(&self) -> Result<Option<f64>, BridgeError> {
        self.remote.get("code").await
    }

    /// `ProtocolError.originalMessage`
    ///
    /// ```text
    /// get originalMessage(): string
    /// ```
    pub async fn original_message(&self) -> Result<String, BridgeError> {
        self.remote.get("originalMessage").await
    }
}