pub enum BlockError {
Shape {
block_type: String,
path: String,
reason: String,
},
UnknownType(String),
DanglingReference {
owner: &'static str,
referred: &'static str,
},
MigrateFailed {
block_type: String,
from: u32,
to: u32,
reason: String,
},
TemplateRender {
block_type: String,
template: String,
source: Error,
},
}Expand description
Per-block, sync render error. Stays sync because every render step is pure JSON → HTML — no IO during the rendering pass.
Variants§
Shape
The stored JSON didn’t match the block’s Block::fields
schema. Carries a path so admin can highlight the offending
block.
UnknownType(String)
type_name in the stored JSON doesn’t resolve to a registered
block. Surfaces as the yellow schema-drift banner in the editor.
DanglingReference
register_block! returned a Block::fields() entry referring
to a non-existent block type via Stream::allowed or
Repeat::item_type. Caught at boot-time via
validate_block_registry.
MigrateFailed
block.migrate(from, value) failed to upgrade an older
version. Original JSON is kept on the record; the editor
surfaces the failure in the schema-drift banner.
TemplateRender
Tera failure during a block’s render. The block’s template path
- the underlying Tera message land in the body.
Trait Implementations§
Source§impl Debug for BlockError
impl Debug for BlockError
Source§impl Display for BlockError
impl Display for BlockError
Source§impl Error for BlockError
impl Error for BlockError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for BlockError
impl !UnwindSafe for BlockError
impl Forget for BlockError
impl Freeze for BlockError
impl Send for BlockError
impl Sync for BlockError
impl Unpin for BlockError
impl UnsafeUnpin for BlockError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more