Skip to content

Commit

Permalink
get rid of some unnecessary panics
Browse files Browse the repository at this point in the history
  • Loading branch information
mpldr committed Feb 27, 2024
1 parent dc62979 commit b1191c3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ package api

import (
"encoding/json"
"errors"
"fmt"
"net/http"

"github.com/getsentry/sentry-go"
"github.com/julienschmidt/httprouter"
"github.com/sirupsen/logrus"
"github.com/t2bot/matrix-media-repo/api/_responses"
"github.com/t2bot/matrix-media-repo/api/_routers"
"github.com/t2bot/matrix-media-repo/util"
)

func buildPrimaryRouter() *httprouter.Router {
Expand Down
2 changes: 1 addition & 1 deletion api/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func Stop() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := srv.Shutdown(ctx); err != nil {
panic(err)
logrus.Fatalf("Could not gracefully shutdown the server: %v", err)
}
}
}
2 changes: 1 addition & 1 deletion common/assets/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func SetupMigrations(givenMigrationsPath string) {
if !exists {
tempMigrations, err = os.MkdirTemp(os.TempDir(), "media-repo-migrations")
if err != nil {
panic(err)
logrus.Fatalf("Failed to create temporary migrations directory: %v", err)
}
logrus.Info("Migrations path doesn't exist - attempting to unpack from compiled data")
extractPrefixTo("migrations", tempMigrations)
Expand Down

0 comments on commit b1191c3

Please sign in to comment.