{"record":{"id":"62792e5d6575868b","repo":"juanfont/headscale","slug":"w-s","errorCode":null,"errorMessage":"%w: %s","messagePattern":"%w: %s","errorType":"http","errorClass":"errResponseStatus","httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/utils.go","lineNumber":75,"sourceCode":"\t}\n\n\tif problem.Errors != nil {\n\t\tfor _, e := range *problem.Errors {\n\t\t\tif e.Message != nil && *e.Message != \"\" {\n\t\t\t\tparts = append(parts, *e.Message)\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(parts) == 0 && problem.Title != nil && *problem.Title != \"\" {\n\t\tparts = append(parts, *problem.Title)\n\t}\n\n\tif len(parts) == 0 {\n\t\treturn fmt.Errorf(\"%w: %d %s\", errResponseStatus, statusCode, http.StatusText(statusCode))\n\t}\n\n\treturn fmt.Errorf(\"%w: %s\", errResponseStatus, strings.Join(parts, \": \"))\n}\n\n// mustMarkRequired marks the named flags as required, panicking on an unknown\n// flag. Only called from init(), where a failure is a programming error.\nfunc mustMarkRequired(cmd *cobra.Command, names ...string) {\n\tfor _, n := range names {\n\t\terr := cmd.MarkFlagRequired(n)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"marking flag %q required on %q: %v\", n, cmd.Name(), err))\n\t\t}\n\t}\n}\n\nfunc newHeadscaleServerWithConfig() (*hscontrol.Headscale, error) {\n\tcfg, err := types.LoadServerConfig()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"loading configuration: %w\",","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/utils.go#L57-L93","documentation":"Error \"%w: %s\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/utils.go:75 when the library encounters an invalid state.","commonSituations":"A wrapped error with context was returned by a CLI helper. The inner message identifies the failing operation; check server connectivity and credentials.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}