{"record":{"id":"d82f8f262c4df33e","repo":"matryer/xbar","slug":"get-latest-release","errorCode":null,"errorMessage":"get latest release","messagePattern":"get latest release","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/update/update.go","lineNumber":117,"sourceCode":"\terr = cmd.Start()\n\tif err != nil {\n\t\tif exitErr, ok := err.(*exec.ExitError); ok {\n\t\t\treturn errors.Wrapf(err, \"starting new app failed: exit code %d\", exitErr.ExitCode())\n\t\t}\n\t\treturn errors.Wrap(err, \"starting new app failed\")\n\t}\n\tlog.Println(\"waiting before terminating after update...\")\n\ttime.Sleep(1 * time.Second)\n\tlog.Println(\"terminating after update.\")\n\tos.Exit(0)\n\treturn nil\n}\n\n// getLatestRelease gets the latest release.\nfunc (u *Updater) getLatestRelease() (*Release, error) {\n\tresp, err := u.Client.Get(u.LatestReleaseGitHubEndpoint)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get latest release\")\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, errors.Errorf(\"failed to check for updates: got %s\", resp.Status)\n\t}\n\tb, err := io.ReadAll(io.LimitReader(resp.Body, u.DownloadBytesLimit))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"read body\")\n\t}\n\tvar latestRelease Release\n\terr = json.Unmarshal(b, &latestRelease)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"marshal\")\n\t}\n\tlatestRelease.CreatedAt, err = time.Parse(time.RFC3339Nano, latestRelease.CreatedAtString)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"time.Parse: created_at\")\n\t}","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/matryer/xbar/blob/d624239058997c80118eaebe2e7f8331b3c765e0/pkg/update/update.go#L99-L135","documentation":"Raised in Updater.getLatestRelease when the HTTP GET against u.LatestReleaseGitHubEndpoint (the GitHub releases endpoint) fails at the transport level — DNS failure, no network, TLS error, timeout — so the latest release metadata cannot be fetched and update detection (Update/HasUpdate) cannot proceed.","triggerScenarios":"Thrown at pkg/update/update.go:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify network connectivity and that the machine can reach the GitHub API endpoint","Check the configured LatestReleaseGitHubEndpoint URL for typos or a moved repository","Retry the request with backoff, since transient network failures are common","Check for proxy/firewall or DNS issues on the user's machine","Surface a non-fatal 'update check failed' state so the app continues running the current version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d624239058997c80118eaebe2e7f8331b3c765e0","analyzedAt":"2026-09-02T22:38:22.007Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}