Skip to content
Snippets Groups Projects
Commit 25555e8e authored by Mykyta Savchuk's avatar Mykyta Savchuk
Browse files

Merge branch 'cosmos-429-response' into 'master'

change RequestRateTooLargeException response to 429

See merge request !354
parents daa2e59a 46c98582
No related branches found
No related tags found
1 merge request!354change RequestRateTooLargeException response to 429
Pipeline #285529 skipped
......@@ -46,7 +46,7 @@ The following software have components provided under the terms of this license:
- Guava ListenableFuture only (from https://repo1.maven.org/maven2/com/google/guava/listenablefuture)
- Guava: Google Core Libraries for Java (from http://code.google.com/p/guava-libraries, https://github.com/google/guava, https://repo1.maven.org/maven2/com/google/guava/guava)
- HTTP functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty)
- Hibernate Validator (from http://hibernate.org/validator, https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator)
- Hibernate Validator (from https://hibernate.org/validator, https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator)
- J2ObjC Annotations (from https://github.com/google/j2objc/)
- JBoss Logging 3 (from http://www.jboss.org)
- JCIP Annotations under Apache License (from http://stephenc.github.com/jcip-annotations)
......@@ -212,7 +212,7 @@ The following software have components provided under the terms of this license:
- Guava: Google Core Libraries for Java (from http://code.google.com/p/guava-libraries, https://github.com/google/guava, https://repo1.maven.org/maven2/com/google/guava/guava)
- HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/)
- Hibernate Validator (from http://hibernate.org/validator, https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator)
- Hibernate Validator (from https://hibernate.org/validator, https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator)
- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/)
- Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common)
- Redisson (from http://redisson.org)
......
......@@ -43,7 +43,7 @@ public final class GlobalAzureExceptionMapper {
@ExceptionHandler(RequestRateTooLargeException.class)
protected ResponseEntity<Object> handleCosmosdbException(final RequestRateTooLargeException e) {
return this.getErrorResponse(
new AppException(HttpStatus.SERVICE_UNAVAILABLE.value(), "Service Unavailable",
new AppException(HttpStatus.TOO_MANY_REQUESTS.value(), "Cosmos DB request rate is too large",
"Request rate is large. Please retry this request later", e));
}
......
......@@ -34,7 +34,7 @@ public class GlobalAzureExceptionMapperTest {
ResponseEntity response = this.sut.handleCosmosdbException(exception);
assertEquals(503, response.getStatusCodeValue());
assertEquals("Service Unavailable", ((AppError) response.getBody()).getReason());
assertEquals(429, response.getStatusCodeValue());
assertEquals("Cosmos DB request rate is too large", ((AppError) response.getBody()).getReason());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment