9
0
mirror of https://github.com/Lomanic/presence-button-web synced 2024-11-14 17:57:29 +00:00

Check matrix credentials early on init

This commit is contained in:
Lomanic 2020-10-24 22:32:49 +02:00
parent 257677b313
commit 91999707d0

View File

@ -84,6 +84,9 @@ func init() {
if err != nil {
panic(fmt.Sprintf("error creating matrix client: %s", err))
}
if _, err := matrix.GetOwnStatus(); err != nil { // a way to quickly check if access token is valid
panic(fmt.Sprintf("error getting matrix status: %s", err))
}
if config.MATRIXROOM == "" {
panic("MATRIXROOM is empty")