Source Events ↗

plugins.route_failed

A plugin route handler failed.

When
After the handler returns a negative route status or request body read fails.
Payload
JSON: { plugin, method, path, error }.
Cancelable
No

The daemon returns a 4xx/5xx response for the request.

Use cases

  • Plugin error alerts
  • Debug custom endpoints

Example

Registration and handler

Register

hook!(host, PluginEvent::PluginRouteFailed, on_route_failed);

Handler

extern "C" fn on_event(ctx: *const EventContext) -> HookResult {
    let ctx = unsafe { &*ctx };
    let payload = unsafe { std::slice::from_raw_parts(ctx.payload_ptr, ctx.payload_len) };
    let _json = std::str::from_utf8(payload).unwrap_or_default();
    HookResult::r#continue()
}

← All lifecycle events