Changeset 219 in code for trunk


Ignore:
Timestamp:
Apr 4, 2020, 3:34:12 PM (5 years ago)
Author:
delthas
Message:

Send the last error for disconnected networks in network status

This adds support for sending the exact error message of a network when
it is disconnected, in the reply to the service command `network
status`. This lets users easily examine why a network is currently
disconnected.

No lock is needed because all reads and writes of network.lastError are
made in the user goroutine.

Closes: https://todo.sr.ht/~emersion/soju/28

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/service.go

    r218 r219  
    209209                } else {
    210210                        statuses = append(statuses, "disconnected")
     211                        if net.lastError != nil {
     212                                details = net.lastError.Error()
     213                        }
    211214                }
    212215
Note: See TracChangeset for help on using the changeset viewer.