Check matrix credentials early on init

This commit is contained in:
Lomanic 2020-10-24 22:32:49 +02:00
parent 257677b313
commit 91999707d0
1 changed files with 3 additions and 0 deletions

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")