Skip to content

Commit

Permalink
migrator: errors.As requires pointer as input (sourcegraph#49596)
Browse files Browse the repository at this point in the history
I ran into a panic locally which pointed at this line:

  panic: errors.As: target must be a non-nil pointer, found pgconn.PgError
  ...snip
  github.com/sourcegraph/sourcegraph/internal/database/migration/runner.(*Runner).createIndexConcurrently.func3({0x63afbe0, 0xc002cda2d0})
  /home/keegan/src/github.com/sourcegraph/sourcegraph/internal/database/migration/runner/run.go:501 +0x79

Test Plan: I'm unsure how to get that code path executing again, so just
assuming this is correct by inspection.
  • Loading branch information
keegancsmith committed Mar 17, 2023
1 parent 2680c22 commit bf603e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/database/migration/runner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ pollIndexStatusLoop:
if err == nil {
return err
}
if !errors.As(err, pgErr) || pgErr.Code != "42P07" {
if !errors.As(err, &pgErr) || pgErr.Code != "42P07" {
return err
}

Expand Down

0 comments on commit bf603e4

Please sign in to comment.