brisk_it/
errors.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Convenient function to generate errors

///
pub fn unknown_property(prop: crate::component::PropertyValue) -> proc_macro2::TokenStream {
    return syn::Error::new(prop.name.span(), format!("Unknown property {}", prop.name))
        .into_compile_error()
        .into();
}

///
pub fn missing_property(component_name: &syn::Ident, prop_name: &str) -> proc_macro2::TokenStream {
    return syn::Error::new(
        component_name.span(),
        format!("Missing required property '{}'", prop_name),
    )
    .into_compile_error()
    .into();
}