Trait XpErrorHandler

Source
pub trait XpErrorHandler {
    type Error: RuntimeError;

    // Required method
    fn from_xp_error(e: XpError) -> Self::Error;
}
Expand description

A trait for mapping domain-level XP errors into caller- or pallet-specific error types.

This trait acts as a bridge between the generic, FRAME-agnostic XpError enum and the concrete error type expected by the execution context.

Required Associated Types§

Source

type Error: RuntimeError

Concrete error type produced by the handler.

Implements conversion to [DispatchError].

Required Methods§

Source

fn from_xp_error(e: XpError) -> Self::Error

Converts a generic XpError into the handler’s concrete error type which implements Into<DispatchError>.

This function centralizes error translation logic and ensures that all balance-related failures are surfaced consistently according to the caller’s error domain.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§