control/controlclient,tailcfg: propagate registration errors to the frontend

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2021-10-26 10:19:35 -07:00
committed by Maisem Ali
parent 139a6c4c9c
commit 81cabf48ec
8 changed files with 18 additions and 13 deletions

View File

@@ -448,12 +448,14 @@ func (b *LocalBackend) SetDecompressor(fn func() (controlclient.Decompressor, er
// Among other things, this is where we update the netmap, packet filters, DNS and DERP maps.
func (b *LocalBackend) setClientStatus(st controlclient.Status) {
// The following do not depend on any data for which we need to lock b.
if st.Err != "" {
if st.Err != nil {
// TODO(crawshaw): display in the UI.
if st.Err == "EOF" {
if errors.Is(st.Err, io.EOF) {
b.logf("[v1] Received error: EOF")
} else {
b.logf("Received error: %v", st.Err)
e := st.Err.Error()
b.send(ipn.Notify{ErrMessage: &e})
}
return
}

View File

@@ -137,9 +137,7 @@ func (cc *mockControl) send(err error, url string, loginFinished bool, nm *netma
URL: url,
NetMap: nm,
Persist: &cc.persist,
}
if err != nil {
s.Err = err.Error()
Err: err,
}
if loginFinished {
s.LoginFinished = &empty.Message{}