{"record":{"id":"7c728845c62248d1","repo":"nautechsystems/nautilus_trader","slug":"invalid-label-value-e","errorCode":null,"errorMessage":"Invalid {label} '{value}': {e}","messagePattern":"Invalid (.+?) '(.+?)': (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/betfair/src/config.rs","lineNumber":56,"sourceCode":"};\n\nfn parse_currency(code: &str) -> anyhow::Result<Currency> {\n    code.parse::<Currency>()\n        .map_err(|_| anyhow::anyhow!(\"Invalid account currency code: {code}\"))\n}\n\nfn make_min_notional(value: Option<Decimal>, currency: Currency) -> anyhow::Result<Option<Money>> {\n    value\n        .map(|amount| Money::from_decimal(amount, currency))\n        .transpose()\n        .map_err(Into::into)\n}\n\nfn validate_market_start_time(label: &str, value: &Option<String>) -> anyhow::Result<()> {\n    if let Some(value) = value {\n        parse_betfair_timestamp(value)\n            .map(|_| ())\n            .map_err(|e| anyhow::anyhow!(\"Invalid {label} '{value}': {e}\"))?;\n    }\n\n    Ok(())\n}\n\nfn resolve_credential(\n    username: Option<SecretString>,\n    password: Option<SecretString>,\n    app_key: Option<SecretString>,\n) -> anyhow::Result<BetfairCredential> {\n    match BetfairCredential::resolve(\n        username.map(SecretString::into_inner),\n        password.map(SecretString::into_inner),\n        app_key.map(SecretString::into_inner),\n    ) {\n        Ok(Some(credential)) => Ok(credential),\n        Ok(None) => anyhow::bail!(\"Missing Betfair credentials in config and environment\"),\n        Err(e) => Err(match e {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/betfair/src/config.rs#L38-L74","documentation":"Betfair config validation for optional market start-time strings: when a value is present it must parse as a Betfair timestamp; parse_betfair_timestamp failures are re-raised as 'Invalid {label} ...' including the underlying parse error.","triggerScenarios":"Providing a non-empty market_start_time-like config field whose string does not match the expected Betfair timestamp format (wrong layout, timezone suffix, or garbage text).","commonSituations":"Hand-writing dates in local format, missing the required ISO/UTC layout, or copying times from other APIs with different formats.","solutions":["Format the value exactly as parse_betfair_timestamp expects (Betfair ISO-style timestamp)","Check the inner {e} message for the precise parse failure position","Omit the field entirely if you don't need a market start time filter"],"exampleFix":"// before\nmarket_start_time = \"2026-09-08 09:00\"\n// after\nmarket_start_time = \"2026-09-08T09:00:00.000Z\"","handlingStrategy":"validation","validationCode":"// Rust\n// Mirror the adapter's parser before building config\nif let Some(ts) = &cfg.market_start_time {\n    parse_betfair_timestamp(ts).expect(\"invalid Betfair timestamp\");\n}","typeGuard":null,"tryCatchPattern":"match validate(&config) {\n    Ok(c) => c,\n    Err(e) => { eprintln!(\"config invalid: {e:#}\"); std::process::exit(2); }\n}","preventionTips":["Always emit Betfair-style ISO timestamps with millisecond precision and Z suffix","Run config validation early at startup, not at connect time","Omit optional time filters rather than sending empty/garbage strings","Add a unit test that round-trips your timestamp format through the parser"],"tags":["config","datetime","validation","betfair"],"backgroundTag":"invalid-date-format","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}