Commit 34bbf55b authored by neelesh thakur's avatar neelesh thakur
Browse files

refactor

parent 9b9bc1db
Pipeline #65760 passed with stages
in 43 minutes and 44 seconds
This diff is collapsed.
......@@ -58,7 +58,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.11.0-SNAPSHOT</version>
<version>0.11.0</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
......
// Copyright © Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.storage.provider.azure.util;
import com.azure.cosmos.implementation.RequestRateTooLargeException;
......@@ -9,11 +23,11 @@ import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
@ControllerAdvice
public class GlobalCosmosExceptionMapper {
public class GlobalAzureExceptionMapper {
private GlobalExceptionMapper mapper;
public GlobalCosmosExceptionMapper(GlobalExceptionMapper mapper) {
public GlobalAzureExceptionMapper(GlobalExceptionMapper mapper) {
this.mapper = mapper;
}
......@@ -21,7 +35,7 @@ public class GlobalCosmosExceptionMapper {
protected ResponseEntity<Object> handleCosmosdbException(Exception e) {
return mapper.getErrorResponse(
new AppException(HttpStatus.SERVICE_UNAVAILABLE.value(), "Too many requests on cosmosdb.",
e.getMessage(), e));
"Request rate is large. Please retry this request later", e));
}
}
......
// Copyright © Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.storage.provider.azure.util;
import com.azure.cosmos.implementation.RequestRateTooLargeException;
......@@ -18,10 +32,10 @@ import static org.mockito.Mockito.when;
import static org.springframework.http.HttpStatus.SERVICE_UNAVAILABLE;
@RunWith(MockitoJUnitRunner.class)
public class GlobalCosmosExceptionMapperTest {
public class GlobalAzureExceptionMapperTest {
@InjectMocks
private GlobalCosmosExceptionMapper sut;
private GlobalAzureExceptionMapper sut;
@Mock
private GlobalExceptionMapper mapper;
......
......@@ -41,7 +41,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>core-lib-gcp</artifactId>
<version>0.11.0-SNAPSHOT</version>
<version>0.11.0</version>
</dependency>
<dependency>
......
......@@ -90,7 +90,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>core-lib-gcp</artifactId>
<version>0.11.0-SNAPSHOT</version>
<version>0.11.0</version>
</dependency>
</dependencies>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment