pub fn emit_state_with_error<E: EventEmitter>(
channel: &E,
request_id: &str,
state: TransferState,
error: Option<AppError>,
) -> Result<(), AppError>Expand description
Emit a transfer:state event with an optional AppError attached.
Intended for Failed transitions: pass the underlying error so the
frontend’s applyStateEvent can hydrate the failure reason onto the
transfer record. Non-Failed callers should keep using emit_state.