diff --git a/crates/relax-macros/src/lib.rs b/crates/relax-macros/src/lib.rs index f21baaf..372f2ff 100644 --- a/crates/relax-macros/src/lib.rs +++ b/crates/relax-macros/src/lib.rs @@ -169,9 +169,9 @@ fn derive_impl(input: syn::DeriveInput) -> syn::Result { .any(|attr| attr.path().is_ident("relax")); Ok(match (nested, get_generic_ty("Option", ty).is_some()) { - (false, false) => quote! { #name: value.#name.ok_or(::relax::MissingRequiredField(stringify!(#name)))? }, + (false, false) => quote! { #name: value.#name.ok_or(::relax::RequiredFieldNotSet(stringify!(#name)))? }, (false, true) => quote! { #name: value.#name }, - (true, false) => quote! { #name: value.#name.ok_or(::relax::MissingRequiredField(stringify!(#name)))?.try_into()? }, + (true, false) => quote! { #name: value.#name.ok_or(::relax::RequiredFieldNotSet(stringify!(#name)))?.try_into()? }, (true, true) => quote! { #name: value.#name.map(|val| val.try_into()).transpose().ok().flatten() }, }) }).collect::>>()?; @@ -211,7 +211,7 @@ fn derive_impl(input: syn::DeriveInput) -> syn::Result { } impl #generics ::std::convert::TryFrom<#partial #generics> for #base #generics { - type Error = ::relax::MissingRequiredField; + type Error = ::relax::RequiredFieldNotSet; fn try_from(value: #partial) -> ::std::result::Result { Ok(Self{