From 91999707d0b9318e3f849125c8aa5264f9e2e7ae Mon Sep 17 00:00:00 2001 From: Lomanic Date: Sat, 24 Oct 2020 22:32:49 +0200 Subject: [PATCH] Check matrix credentials early on init --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 0340e02..9f91039 100644 --- a/main.go +++ b/main.go @@ -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")