{"record":{"id":"5156bb121fb1c273","repo":"influxdata/influxdb","slug":"failed-to-parse-as-integer-0","errorCode":null,"errorMessage":"failed to parse as integer: {0}","messagePattern":"failed to parse as integer: (.+?)","errorType":"error_code","errorClass":"IdParseError","httpStatus":null,"severity":"error","filePath":"influxdb3_id/src/lib.rs","lineNumber":31,"sourceCode":"mod serialize;\npub use serialize::{SerdeVecMap, SerdeVecSet};\n\n#[derive(Debug, thiserror::Error)]\n#[error(\"unable to parse as integer: {0}\")]\npub struct IdParsingError(#[from] ParseIntError);\n\npub trait CatalogId: Default + Hash + Eq + Copy + Ord + Serialize + Display {\n    type Integer;\n\n    const MAX: Self;\n\n    fn next(&self) -> Self;\n\n    fn checked_next(&self) -> Option<Self>;\n}\n\n#[derive(Debug, thiserror::Error)]\n#[error(\"failed to parse as integer: {0}\")]\npub struct IdParseError(#[from] ParseIntError);\n\nmacro_rules! catalog_identifier_type {\n    ($name:ident, $ty:ty) => {\n        #[derive(\n            Debug, Copy, Clone, Eq, PartialOrd, Ord, PartialEq, Serialize, Deserialize, Hash,\n        )]\n        pub struct $name($ty);\n\n        impl CatalogId for $name {\n            type Integer = $ty;\n\n            const MAX: Self = Self(<$ty>::MAX);\n\n            fn next(&self) -> Self {\n                Self::new(self.0.checked_add(1).expect(\"incrementing id overflow\"))\n            }\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_id/src/lib.rs#L13-L49","documentation":"`IdParseError` in influxdb3_id is the newer parse error used by generated catalog identifier types (via the `catalog_identifier_type!` macro). It wraps `ParseIntError` and renders as \"failed to parse as integer: {0}\" when a string cannot be converted to the identifier's integer backing type.","triggerScenarios":"Parsing a catalog object ID (table, database, column IDs) from string input — path segments, query parameters, or serialized catalog — that is non-numeric, empty, or out of range for the backing integer type.","commonSituations":"Hand-editing serialized catalog data; passing names instead of numeric IDs; copying an ID from a different deployment with a different format.","solutions":["Supply a valid numeric ID within the backing type's range","Look up the numeric ID via the catalog/API instead of guessing from names","Strip whitespace or encoding from the string before parsing"],"exampleFix":"// before\nlet table_id: TableId = \"weather\".parse()?;\n// after\nlet table_id: TableId = \"17\".parse()?;","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// rust\nfn try_table_id(s: &str) -> Option<TableId> {\n    s.trim().parse::<TableId>().ok()\n}","tryCatchPattern":"// rust\nlet id = try_table_id(raw).ok_or_else(|| anyhow!(\"expected numeric table id, got {raw}\"))?;","preventionTips":["Do not hand-edit serialized catalog data","Resolve names to numeric IDs via the catalog before parsing","Handle parse errors at deserialization boundaries with clear context"],"tags":["parsing","integer","identifier","catalog"],"backgroundTag":"invalid-identifier-format","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}