aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--backend/auth/auth.go2
-rw-r--r--backend/game/hub.go3
2 files changed, 3 insertions, 2 deletions
diff --git a/backend/auth/auth.go b/backend/auth/auth.go
index b79161f..7d9a4c2 100644
--- a/backend/auth/auth.go
+++ b/backend/auth/auth.go
@@ -39,7 +39,7 @@ func Login(
// Authenticate with password.
passwordHash := userAuth.PasswordHash
if passwordHash == nil {
- panic("inconsistant data")
+ return 0, errors.New("inconsistent data: password auth type but no password hash")
}
err := bcrypt.CompareHashAndPassword([]byte(*passwordHash), []byte(password))
if err != nil {
diff --git a/backend/game/hub.go b/backend/game/hub.go
index c9e9680..d918543 100644
--- a/backend/game/hub.go
+++ b/backend/game/hub.go
@@ -97,7 +97,8 @@ func (hub *Hub) processTaskResults() {
continue
}
default:
- panic("unexpected task result type")
+ slog.Error("unexpected task result type", "type", taskResult.Type())
+ continue
}
}
}