mirror of
https://github.com/matrix-org/dendrite
synced 2024-11-15 22:31:07 +01:00
Only return 500 on /send if a database error occurs (#1503)
This commit is contained in:
parent
2bd0449c5b
commit
4df7e345bb
1 changed files with 5 additions and 11 deletions
|
@ -16,6 +16,7 @@ package routing
|
|||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
@ -234,18 +235,11 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res
|
|||
// we should stop processing the transaction, and returns false if it
|
||||
// is just some less serious error about a specific event.
|
||||
func isProcessingErrorFatal(err error) bool {
|
||||
switch err.(type) {
|
||||
case roomNotFoundError:
|
||||
case *gomatrixserverlib.NotAllowed:
|
||||
case missingPrevEventsError:
|
||||
default:
|
||||
switch err {
|
||||
case context.Canceled:
|
||||
case context.DeadlineExceeded:
|
||||
default:
|
||||
case sql.ErrConnDone:
|
||||
case sql.ErrTxDone:
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue