Skip to content

Commit ceeaeab

Browse files
committed
update error handling for app maintenance
1 parent f99129c commit ceeaeab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/wordvault/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ func (s *Server) appMaintenance(ctx context.Context) (bool, error) {
332332
// Check if the error is related to the table not existing.
333333
// If so, don't return an error. We want to make this app as
334334
// independent as we can.
335-
if pgErr, ok := err.(*pgconn.PgError); ok && pgErr.Code == "42P01" {
335+
var pgErr *pgconn.PgError
336+
if errors.As(err, &pgErr) && pgErr.Code == "42P01" {
336337
log.Info().AnErr("pg-err", pgErr).Msg("waffle-table-not-defined")
337338
return false, nil
338339
}

0 commit comments

Comments
 (0)