You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider adding a message field to AttributeError.
It is useful for debug purposes to know what exactly might have failed when parsing the attributes instead of
information-less AttributeError::InvalidType and AttributeError::InvalidFormat.
It might look like this:
So I created a db::Id struct which represents an string of format kind#uuid:
The code is this:
structId<K>(Uuid,PhantomData<*mutK>);// ToString and FromStr implementation for Id<K> is skipped...impl<K:HasKindTag> dynomite::AttributeforId<K>{fninto_attr(self:Self) -> dynamodb::AttributeValue{self.to_string().into_attr()}fnfrom_attr(value: dynamodb::AttributeValue) -> Result<Self, dynomite::AttributeError>{
value
.s// we lose the info about the original type in the error message here.ok_or_else(|| dynomite::AttributeError::InvalidType)?
.parse()// Unfortunatelly we lose error message from parsing here too....map_err(|_err| dynomite::AttributeError::InvalidFormat)}}
The text was updated successfully, but these errors were encountered:
💡 Feature description
Consider adding a message field to
AttributeError
.It is useful for debug purposes to know what exactly might have failed when parsing the attributes instead of
information-less
AttributeError::InvalidType
andAttributeError::InvalidFormat
.It might look like this:
💻 Basic example
In my case I try to follow single-table dynamodb design.
So I created a
db::Id
struct which represents an string of formatkind#uuid
:The code is this:
The text was updated successfully, but these errors were encountered: