auth.Login (pkg/auth/auth.go) returns "Bad credentials" for sql.ErrNoRows, but calls panic(err) for any other database error. CheckCredentials returns the same error normally. The panic reaches gin's recovery middleware and turns a transient database problem into a 500 with a stack trace in the logs.
Repro: call auth.Login with an executor whose query fails, for example a closed connection. It panics.
Expected: Login returns the error.
Pinned by a skipped test in pkg/auth/auth_db_test.go (W2).
auth.Login(pkg/auth/auth.go) returns "Bad credentials" forsql.ErrNoRows, but callspanic(err)for any other database error.CheckCredentialsreturns the same error normally. The panic reaches gin's recovery middleware and turns a transient database problem into a 500 with a stack trace in the logs.Repro: call
auth.Loginwith an executor whose query fails, for example a closed connection. It panics.Expected:
Loginreturns the error.Pinned by a skipped test in
pkg/auth/auth_db_test.go(W2).