use crate::permission::Permission;

pub struct CapabilityError {
    pub message: String,
}

impl CapabilityError {
    pub fn into_syn_error(self, span: &(impl syn::spanned::Spanned + quote::ToTokens), permission: Permission) -> syn::Error {
        syn::Error::new_spanned(span, format!("{}\nhint: add `[#capability({permission})]` to the function", self.message))
    }
}
