mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Also cover Fatal and Panic logging
This commit is contained in:
parent
fe8f570929
commit
c4cc35fcfc
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
@ -46,6 +47,7 @@ func NewStorage(postgresURI string) *Storage {
|
||||
db, err := sqlx.Open("postgres", postgresURI)
|
||||
if err != nil {
|
||||
logger.Panic().Err(err).Str("uri", postgresURI).Msg("failed to open SQL DB")
|
||||
sentry.CaptureException(err)
|
||||
}
|
||||
acc := &Accumulator{
|
||||
db: db,
|
||||
|
2
v3.go
2
v3.go
@ -3,6 +3,7 @@ package slidingsync
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
@ -169,6 +170,7 @@ func RunSyncV3Server(h http.Handler, bindAddr, destV2Server, tlsCert, tlsKey str
|
||||
}
|
||||
if err != nil {
|
||||
logger.Fatal().Err(err).Msg("failed to listen and serve")
|
||||
sentry.CaptureException(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user