mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-04-11 22:33:40 +00:00
Simplify error checking
This commit is contained in:
parent
12a9538282
commit
5f576148ac
1 changed files with 1 additions and 3 deletions
|
@ -130,9 +130,7 @@ func (s *accountsStatements) selectAccountByLocalpart(
|
||||||
stmt := s.selectAccountByLocalpartStmt
|
stmt := s.selectAccountByLocalpartStmt
|
||||||
err := stmt.QueryRowContext(ctx, localpart).Scan(&acc.Localpart, &appserviceIDPtr)
|
err := stmt.QueryRowContext(ctx, localpart).Scan(&acc.Localpart, &appserviceIDPtr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
switch err {
|
if err != sql.ErrNoRows {
|
||||||
case sql.ErrNoRows:
|
|
||||||
default:
|
|
||||||
log.WithError(err).Error("Unable to retrieve user from the db")
|
log.WithError(err).Error("Unable to retrieve user from the db")
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue