objectiveai_sdk/error/
http.rs1use crate::{HttpClient, HttpError, McpHandler, Notifier};
3use futures::Stream;
4
5pub async fn create_error_unary(
7 client: &HttpClient,
8 mut params: super::request::ErrorCreateParams,
9) -> Result<super::response::ErrorResponse, HttpError> {
10 params.stream = None;
11 client
12 .send_unary(reqwest::Method::POST, "error", Some(params))
13 .await
14}
15
16pub async fn create_error_streaming<H: McpHandler>(
21 client: &HttpClient,
22 mut params: super::request::ErrorCreateParams,
23 handler: H,
24) -> Result<
25 (
26 impl Stream<Item = Result<super::response::ErrorResponse, HttpError>>
27 + Send
28 + Unpin
29 + 'static
30 + use<H>,
31 Notifier,
32 ),
33 HttpError,
34> {
35 params.stream = Some(true);
36 client
37 .send_streaming_ws(reqwest::Method::POST, "error", params, handler)
38 .await
39}