Don't panic at runtime in case of temporary network hiccups

This commit is contained in:
Lomanic 2020-11-07 19:41:35 +01:00
parent d3d1b1676c
commit ef10e0fcb4
1 changed files with 2 additions and 2 deletions

View File

@ -244,7 +244,7 @@ func syncMatrix() {
go func() { // set online status every 15 seconds go func() { // set online status every 15 seconds
for { for {
if err := matrix.SetStatus("online", "up and running"); err != nil { if err := matrix.SetStatus("online", "up and running"); err != nil {
panic(fmt.Sprintf("error setting matrix status: %s", err)) fmt.Println("error setting matrix status:", err)
} }
time.Sleep(15 * time.Second) time.Sleep(15 * time.Second)
} }
@ -252,7 +252,7 @@ func syncMatrix() {
for { for {
if err := matrix.Sync(); err != nil { if err := matrix.Sync(); err != nil {
fmt.Println("Sync() returned ", err) fmt.Println("error syncing with matrix:", err)
} }
} }
} }