{"record":{"id":"462e95cfc7e41dda","repo":"JanDeDobbeleer/oh-my-posh","slug":"no-scheduled-game-found-for-team","errorCode":null,"errorMessage":"no scheduled game found for team","messagePattern":"no scheduled game found for team","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/segments/nba.go","lineNumber":166,"sourceCode":"\nfunc (nba *Nba) findGameScoreByTeamTricode(games []Game, teamTricode string) (*Game, error) {\n\tfor _, game := range games {\n\t\tif game.HomeTeam.TeamTricode == teamTricode || game.AwayTeam.TeamTricode == teamTricode {\n\t\t\treturn &game, nil\n\t\t}\n\t}\n\n\treturn nil, errors.New(\"no game score found for team\")\n}\n\nfunc (nba *Nba) findGameSchedulebyTeamTricode(games []ScheduledGame, teamTricode string) (*ScheduledGame, error) {\n\tfor _, game := range games {\n\t\tif game.VtAbbreviation == teamTricode || game.HtAbbreviation == teamTricode {\n\t\t\treturn &game, nil\n\t\t}\n\t}\n\n\treturn nil, errors.New(\"no scheduled game found for team\")\n}\n\nfunc (nba *Nba) parseTimetoUTC(timeEST, date string) string {\n\tcombinedTime := date + \" \" + timeEST\n\ttimeUTC, err := time.Parse(\"01/02/2006 03:04 PM\", combinedTime)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\treturn timeUTC.UTC().Format(\"2006-01-02T15:04:05Z\")\n}\n\nfunc (nba *Nba) retrieveScoreData(teamName string, httpTimeout int) (*NBAData, error) {\n\tbody, err := nba.env.HTTPRequest(NBAScoreURL, nil, httpTimeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/nba.go#L148-L184","documentation":"The NBA segment failed to find a game for the configured team tricode in a day's schedule list returned by the NBA broadcaster schedule endpoint. findGameSchedulebyTeamTricode scans CompleteGameList for a game whose visiting (vtAbbreviation) or home (htAbbreviation) abbreviation matches the team option; if none matches for that day it returns this sentinel error, which the caller treats as 'try the next day'. If it persists across all days, the schedule lookup ultimately fails and the segment hides.","triggerScenarios":"Calling retrieveScheduleData with a team option whose tricode does not appear in the schedule for the queried date — e.g. the team did not play that day, or the tricode is wrong (LAL vs LA, BRO vs BKN) or lowercased ('lal' — comparison is case-sensitive exact match against the API's uppercase tricodes).","commonSituations":"NBA off-season or no-game days, mistyped/misspelled team abbreviations, using full team names instead of 3-letter tricodes, or the schedule endpoint payload shape changing so ResultSets[1] no longer holds the right list.","solutions":["Set the team option to the exact uppercase NBA tricode (e.g. \"LAL\", \"BKN\").","Raise days_offset if the team plays within a few days (default window is 8 days).","Verify the season option matches an active NBA season; stale seasons return empty schedules.","Check that the tricode case matches — the comparison is case-sensitive.","Confirm the game day is within the schedule window the endpoint returns."],"exampleFix":"// before\n\"team\": \"lakers\"\n// after\n\"team\": \"LAL\"","handlingStrategy":"validation","validationCode":"const tricode = \"LAL\" // must be exact uppercase NBA tricode\nif (!/^[A-Z]{2,3}$/.test(tricode)) {\n  throw new Error(`team option must be an uppercase tricode, got: ${tricode}`)\n}","typeGuard":null,"tryCatchPattern":"try {\n  game = findGameSchedulebyTeamTricode(games, tricode)\n} catch (e) {\n  if (e.message === \"no scheduled game found for team\") {\n    // treat as \"no game today\", advance to next day or hide segment\n  } else { throw e }\n}","preventionTips":["Use official NBA tricodes (LAL, BKN, GSW) in uppercase.","Set days_offset high enough to span the gap to the next game.","Keep the season option on the current season.","Remember the match is case-sensitive — never pass lowercase names."],"tags":["nba","config","api","segment"],"backgroundTag":"lookup-not-found","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}