{"record":{"id":"c0b32ceac42d64dd","repo":"larksuite/cli","slug":"expected-relative-7d-1m-1y-date-yyyy-mm-dd-hh","errorCode":null,"errorMessage":"expected relative (7d/1m/1y), date (YYYY-MM-DD[ HH:MM:SS]), RFC3339, or unix seconds","messagePattern":"expected relative \\(7d/1m/1y\\), date \\(YYYY-MM-DD\\[ HH:MM:SS\\]\\), RFC3339, or unix seconds","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/drive/drive_search.go","lineNumber":660,"sourceCode":"\t}\n\n\t// Digit-only string at the end so \"20260423\" doesn't get misread as unix.\n\t// Real unix seconds for recent times are 10 digits; be conservative and\n\t// require length >= 10 to avoid matching YYYYMMDD. Mirror unixToISO8601's\n\t// ms-vs-s heuristic: 13-digit / >= 1e12 inputs are epoch-millis and get\n\t// normalized to seconds, otherwise a copy-pasted ms timestamp would\n\t// silently parse as a year-57000 unix and then trip the 1-year cap with\n\t// a misleading message.\n\tif len(s) >= 10 {\n\t\tif n, err := strconv.ParseInt(s, 10, 64); err == nil {\n\t\t\tif n >= 1e12 {\n\t\t\t\tn /= 1000\n\t\t\t}\n\t\t\treturn n, nil\n\t\t}\n\t}\n\n\treturn 0, fmt.Errorf(\"expected relative (7d/1m/1y), date (YYYY-MM-DD[ HH:MM:SS]), RFC3339, or unix seconds\") //nolint:forbidigo // intermediate parse helper; caller wraps into typed ValidationError\n}\n\nfunc callDriveSearchAPI(runtime *common.RuntimeContext, reqBody map[string]interface{}) (map[string]interface{}, error) {\n\tdata, err := runtime.CallAPITyped(\"POST\", \"/open-apis/search/v2/doc_wiki/search\", nil, reqBody)\n\tif err != nil {\n\t\treturn nil, enrichDriveSearchError(err)\n\t}\n\treturn data, nil\n}\n\n// enrichDriveSearchError adds a +search-specific hint for a known opaque Lark\n// code; other errors pass through unchanged. The hint is appended in place on\n// the typed Problem, preserving its category / subtype / code / log_id.\nfunc enrichDriveSearchError(err error) error {\n\tp, ok := errs.ProblemOf(err)\n\tif !ok || p.Code != driveSearchErrUserNotVisible {\n\t\treturn err\n\t}","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/drive/drive_search.go#L642-L678","documentation":"Guard in parseTimeValue: the input matches none of the accepted time formats — relative (7d/1m/1y), date (YYYY-MM-DD[ HH:MM:SS]), RFC3339, or unix seconds — so no time could be derived.","triggerScenarios":"Thrown at shortcuts/drive/drive_search.go:660 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the documented formats: 7d/1m/1y, YYYY-MM-DD[ HH:MM:SS], RFC3339, or unix seconds"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}