browser_commander/puppeteer/api/connection_closed_error.rs
1// @generated by scripts/generate-puppeteer-bindings.mjs from
2// rust/protocol/puppeteer/api.json. Do not edit by hand.
3
4#![allow(clippy::all, missing_docs, unused_imports, non_snake_case)]
5
6use serde_json::Value;
7
8use super::*;
9use crate::puppeteer::bridge::{binary, remote_type, BridgeError, JsFunction, Remote};
10
11remote_type!(
12 /// Puppeteer's `ConnectionClosedError` (puppeteer-core 25.10.0), a remote object
13 /// served by `browser-commander serve --stdio`.
14 ///
15 /// Extends [`ProtocolError`]; the inherited methods are repeated here.
16 ConnectionClosedError
17);
18
19impl ConnectionClosedError {
20 /// `ProtocolError.code`
21 ///
22 /// ```text
23 /// get code(): number | undefined
24 /// ```
25 pub async fn code(&self) -> Result<Option<f64>, BridgeError> {
26 self.remote.get("code").await
27 }
28
29 /// `ProtocolError.originalMessage`
30 ///
31 /// ```text
32 /// get originalMessage(): string
33 /// ```
34 pub async fn original_message(&self) -> Result<String, BridgeError> {
35 self.remote.get("originalMessage").await
36 }
37}