{"record":{"id":"f1cb7996165a80b8","repo":"juspay/hyperswitch","slug":"error-error-type-enum-attribute-not-found","errorCode":null,"errorMessage":"error(error_type_enum) attribute not found","messagePattern":"error\\(error_type_enum\\) attribute not found","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/router_derive/src/macros/api_error/helpers.rs","lineNumber":90,"sourceCode":"    fn get_type_properties(&self) -> syn::Result<ErrorTypeProperties> {\n        let mut output = ErrorTypeProperties::default();\n\n        let mut error_type_enum_keyword = None;\n        for meta in self.get_metadata()? {\n            match meta {\n                EnumMeta::ErrorTypeEnum { keyword, value } => {\n                    if let Some(first_keyword) = error_type_enum_keyword {\n                        return Err(occurrence_error(first_keyword, keyword, \"error_type_enum\"));\n                    }\n\n                    error_type_enum_keyword = Some(keyword);\n                    output.error_type_enum = Some(value);\n                }\n            }\n        }\n\n        if output.error_type_enum.is_none() {\n            return Err(syn::Error::new(\n                self.span(),\n                \"error(error_type_enum) attribute not found\",\n            ));\n        }\n\n        Ok(output)\n    }\n}\n\nenum VariantMeta {\n    ErrorType {\n        keyword: keyword::error_type,\n        value: TypePath,\n    },\n    Code {\n        keyword: keyword::code,\n        value: LitStr,\n    },","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/juspay/hyperswitch/blob/705a3219504c3cf9034e71d956455f8834ea4e64/crates/router_derive/src/macros/api_error/helpers.rs#L72-L108","documentation":"Error \"error(error_type_enum) attribute not found\" thrown in juspay/hyperswitch.","triggerScenarios":"Thrown at crates/router_derive/src/macros/api_error/helpers.rs:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the #[error(error_type = ...)] attribute to the error enum variant as required by the api_error derive macro"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"705a3219504c3cf9034e71d956455f8834ea4e64","analyzedAt":"2026-08-19T10:36:43.745Z","contentChangedAt":"2026-08-19T10:36:43.745Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}