sea_query_derive/iden/
error.rs1use syn::Ident;
2
3use super::path::IdenPath;
4
5#[derive(Debug, thiserror::Error)]
6pub enum ErrorMsg {
7 #[error(
8 "Only the attributes `#[iden = \"name\"]` or `#[iden(rename = \"name\") are supported in this position"
9 )]
10 ContainerAttr,
11 #[error("Must be a string literal")]
12 WrongLiteral,
13 #[error(
14 "The method attribute only supports the `#[{0} = \"name\"]` or `#[iden({0} = \"name\")]` formats"
15 )]
16 WrongNamedValueFormat(IdenPath, IdenPath),
17 #[error("Must one of the following attributes: `flatten`, `rename` or `method`")]
18 WrongListFormat,
19 #[error(
20 "The iden attribute supports only the formats `#[iden = \"name\"]` or `#[iden(<ATTRIBUTE>)]` where ATTRIBUTE is either `flatten`, `rename` or `method`"
21 )]
22 WrongAttributeFormat,
23 #[error("{0} is not a supported keyword")]
24 UnsupportedKeyword(Ident),
25 #[error("Must have a single field is supported for flattenning")]
26 UnsupportedFlattenTarget,
27}