don't use bad_database (HTTP 500) for auth check failures

this is not database-related, and may trigger exponential backoff
against us from other servers

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-16 18:19:47 -04:00 committed by June
parent c5c8934db7
commit 6131465d23
2 changed files with 5 additions and 2 deletions

View File

@ -494,7 +494,10 @@ impl Service {
.map_err(|_e| Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed."))?;
if !check_result {
return Err(Error::bad_database("Event has failed auth check with state at the event."));
return Err(Error::BadRequest(
ErrorKind::InvalidParam,
"Event has failed auth check with state at the event.",
));
}
debug!("Gathering auth events");

View File

@ -744,7 +744,7 @@ impl Service {
)
.map_err(|e| {
error!("Auth check failed: {:?}", e);
Error::bad_database("Auth check failed.")
Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed.")
})?;
if !auth_check {