MCPcopy Create free account
hub / github.com/AI45Lab/Code / fire_on_error

Method fire_on_error

core/src/agent/hook_runtime.rs:105–124  ·  view source on GitHub ↗

Fire OnError hook event when an error occurs.

(
        &self,
        session_id: &str,
        error_type: ErrorType,
        error_message: &str,
        context: serde_json::Value,
    )

Source from the content-addressed store, hash-verified

103
104 /// Fire OnError hook event when an error occurs.
105 pub(super) async fn fire_on_error(
106 &self,
107 session_id: &str,
108 error_type: ErrorType,
109 error_message: &str,
110 context: serde_json::Value,
111 ) {
112 if let Some(he) = &self.config.hook_engine {
113 let event = HookEvent::OnError(OnErrorEvent {
114 session_id: session_id.to_string(),
115 error_type,
116 error_message: error_message.to_string(),
117 context,
118 });
119 let he = Arc::clone(he);
120 tokio::spawn(async move {
121 let _ = he.fire(&event).await;
122 });
123 }
124 }
125}

Callers 2

Calls 1

fireMethod · 0.45

Tested by

no test coverage detected