Merge pull request #5862 from influxdata/dom/service-limit-http-code

refactor: return HTTP 400 for service limits
pull/24376/head
kodiakhq[bot] 2022-10-14 18:42:53 +00:00 committed by GitHub
commit 2a1089576b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ impl From<&DmlError> for StatusCode {
}
DmlError::Schema(SchemaError::ServiceLimit(_)) => {
// https://docs.influxdata.com/influxdb/cloud/account-management/limits/#api-error-responses
StatusCode::TOO_MANY_REQUESTS
StatusCode::BAD_REQUEST
}
DmlError::Schema(SchemaError::Conflict(_)) => StatusCode::BAD_REQUEST,
DmlError::Schema(SchemaError::UnexpectedCatalogError(_)) => {

View File

@ -339,5 +339,5 @@ async fn test_schema_limit() {
);
}
);
assert_eq!(err.as_status_code(), StatusCode::TOO_MANY_REQUESTS);
assert_eq!(err.as_status_code(), StatusCode::BAD_REQUEST);
}