mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-23 11:35:25 -04:00
core/network: avoid endless probing when no network backend is present
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package network
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -10,6 +11,10 @@ import (
|
||||
"github.com/yeqown/go-qrcode/writer/standard"
|
||||
)
|
||||
|
||||
// ErrNoNetworkBackend is returned when no supported network management daemon
|
||||
// (NetworkManager, iwd, systemd-networkd, ConnMan) is present on the system.
|
||||
var ErrNoNetworkBackend = errors.New("no supported network backend found")
|
||||
|
||||
func NewManager() (*Manager, error) {
|
||||
detection, err := DetectNetworkStack()
|
||||
if err != nil {
|
||||
@@ -58,7 +63,7 @@ func NewManager() (*Manager, error) {
|
||||
}
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("no supported network backend found: %s", detection.ChosenReason)
|
||||
return nil, fmt.Errorf("%w: %s", ErrNoNetworkBackend, detection.ChosenReason)
|
||||
}
|
||||
|
||||
m := &Manager{
|
||||
|
||||
Reference in New Issue
Block a user