{"record":{"id":"2c7dd7c2d6e45a83","repo":"JanDeDobbeleer/oh-my-posh","slug":"network-type-s-not-found","errorCode":null,"errorMessage":"network type '%s' not found","messagePattern":"network type '(.+?)' not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/runtime/terminal_windows.go","lineNumber":243,"sourceCode":"}\n\nfunc (term *Terminal) Connection(connectionType ConnectionType) (*Connection, error) {\n\tif term.networks == nil {\n\t\tnetworks := term.getConnections()\n\t\tif len(networks) == 0 {\n\t\t\treturn nil, errors.New(\"no connections found\")\n\t\t}\n\n\t\tterm.networks = networks\n\t}\n\n\tfor _, network := range term.networks {\n\t\tif network.Type == connectionType {\n\t\t\treturn network, nil\n\t\t}\n\t}\n\n\tlog.Error(fmt.Errorf(\"network type '%s' not found\", connectionType))\n\treturn nil, &NotImplemented{}\n}\n","sourceCodeStart":225,"sourceCodeEnd":246,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/runtime/terminal_windows.go#L225-L246","documentation":"Terminal.Connection looks up a cached network connection of the requested ConnectionType (e.g. wifi, ethernet, cellular) from the networks collected by getConnections. If networks were collected but none match the requested type, it logs this error and returns &NotImplemented{} - signaling the shell/runtime cannot supply that connection type, not a network failure.","triggerScenarios":"Requesting Connection(\"wifi\") (or another type) when the Windows machine has no adapter of that type, or when the Win32 API enumeration (getConnections) doesn't classify any adapter as the requested type.","commonSituations":"Desktop without Wi-Fi (ethernet-only) while the prompt segment requests wifi info; virtual/VPN adapters that don't report a standard connection type; disconnected adapters omitted from the enumeration.","solutions":["Request a connection type that exists on the machine (check ethernet vs wifi), or make the segment tolerate a missing type.","Check the machine's adapters (Get-NetAdapter) to see which connection types are actually available.","Handle the returned *NotImplemented{} error gracefully in the segment/template (the prompt should just omit the info).","If the adapter exists but isn't detected, verify it isn't a virtual/VPN-only interface and update network drivers."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// Probe which connection types exist before requesting\nnetInfo, _ := shims.NetworkInfo() // or adapter enumeration\nhasType := func(t string) bool {\n    for _, n := range netInfo { if strings.EqualFold(n, t) { return true } }\n    return false\n}","typeGuard":"var notImpl *NotImplemented\nif errors.As(err, &notImpl) {\n    // connection type unsupported on this machine\n}","tryCatchPattern":"conn, err := term.Connection(connectionType)\nif err != nil {\n    if nie, ok := err.(*NotImplemented); ok {\n        // type not available: hide the network segment\n        return nil\n    }\n    return nil\n}","preventionTips":["Check the machine's adapters (Get-NetAdapter) before enabling a wifi/ethernet segment","Handle *NotImplemented{} as 'unsupported', not a fatal error","Don't request a connection type the host doesn't have (ethernet-only desktops)"],"tags":["windows","network","connection"],"backgroundTag":"connection-type-not-found","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}