Commit b3984892 authored by harshit aggarwal's avatar harshit aggarwal
Browse files

Pr comments

parent 992d3309
Pipeline #23737 failed with stages
in 2 minutes and 49 seconds
...@@ -19,17 +19,12 @@ import org.springframework.web.client.RestTemplate; ...@@ -19,17 +19,12 @@ import org.springframework.web.client.RestTemplate;
}) })
public class WksServiceApplication { public class WksServiceApplication {
private final static Logger LOGGER = LoggerFactory.getLogger(SchemaService.class); private final static Logger LOGGER = LoggerFactory.getLogger(WksServiceApplication.class);
public static void main(String[] args) { public static void main(String[] args) {
ApplicationContext context = SpringApplication.run(org.opengroup.osdu.wks.WksServiceApplication.class, args); ApplicationContext context = SpringApplication.run(org.opengroup.osdu.wks.WksServiceApplication.class, args);
try {
SubscriptionManager subscriptionManager = context.getBean(SubscriptionManager.class); SubscriptionManager subscriptionManager = context.getBean(SubscriptionManager.class);
subscriptionManager.subscribeRecordsChangeEvent(); subscriptionManager.subscribeRecordsChangeEvent();
}
catch (Exception e)
{
LOGGER.error(e.getMessage(), e);
}
} }
@Bean("restTemplate") @Bean("restTemplate")
......
...@@ -39,7 +39,7 @@ public class JwtTokenGenerator implements UserCredential { ...@@ -39,7 +39,7 @@ public class JwtTokenGenerator implements UserCredential {
} }
catch (UnsupportedEncodingException e) { catch (UnsupportedEncodingException e) {
LOGGER.error(e.getMessage(), e); LOGGER.warn(e.getMessage(), e);
throw new ApplicationException(e.getMessage(), e.getCause()); throw new ApplicationException(e.getMessage(), e.getCause());
} }
......
...@@ -66,16 +66,16 @@ public class ProcessWKSTransform { ...@@ -66,16 +66,16 @@ public class ProcessWKSTransform {
transformationSucceeded = true; transformationSucceeded = true;
} catch (BadRequestException e) { } catch (BadRequestException e) {
LOGGER.error("Bad Request Reason: {}, pubsub message id: {}", e.getErrorMsg(), LOGGER.warn("Bad Request Reason: {}, pubsub message id: {}", e.getErrorMsg(),
message.getMessageId(), e); message.getMessageId(), e);
} catch (ApplicationException e) { } catch (ApplicationException e) {
LOGGER.error("Application Error Reason: {}, pubsub message id: {}", e.getErrorMsg(), LOGGER.warn("Application Error Reason: {}, pubsub message id: {}", e.getErrorMsg(),
message.getMessageId(), e); message.getMessageId(), e);
} catch (NullPointerException e) { } catch (NullPointerException e) {
LOGGER.error("Invalid format for message with id: {}", message.getMessageId(), e); LOGGER.warn("Invalid format for message with id: {}", message.getMessageId(), e);
} }
catch (Exception e) { catch (Exception e) {
LOGGER.error("Exception encountered processing the message with id: {}", message.getMessageId(), e); LOGGER.warn("Exception encountered processing the message with id: {}", message.getMessageId(), e);
} }
if(!transformationSucceeded) { if(!transformationSucceeded) {
......
...@@ -38,7 +38,7 @@ public class StatusStoreServiceImpl implements StatusStoreService { ...@@ -38,7 +38,7 @@ public class StatusStoreServiceImpl implements StatusStoreService {
cosmosStore.upsertItem(requestIdentity.getDataPartitionId(), cosmosContainerConfig.getDatabase(), cosmosContainerConfig.getRelationshipStatusContainer(), doc.getId(), doc); cosmosStore.upsertItem(requestIdentity.getDataPartitionId(), cosmosContainerConfig.getDatabase(), cosmosContainerConfig.getRelationshipStatusContainer(), doc.getId(), doc);
} }
catch (AppException exception) { catch (AppException exception) {
LOGGER.error("Status update failed for Record ID: {} and Mapping ID: {} with exception {}", relationshipStatus.getRawRecordId(), relationshipStatus.getMappingId(), exception.getError().getMessage(), exception); LOGGER.warn("Status update failed for Record ID: {} and Mapping ID: {} with exception {}", relationshipStatus.getRawRecordId(), relationshipStatus.getMappingId(), exception.getError().getMessage(), exception);
} }
} }
} }
......
...@@ -81,7 +81,7 @@ public class MappingStoreImpl implements MappingStore { ...@@ -81,7 +81,7 @@ public class MappingStoreImpl implements MappingStore {
mappingsList.add(mapper.readValue(content, MappingsModel.class)); mappingsList.add(mapper.readValue(content, MappingsModel.class));
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("Error while processing mappings from blob store {}", e.getMessage(), e); LOGGER.warn("Error while processing mappings from blob store {}", e.getMessage(), e);
} }
} }
return mappingsList; return mappingsList;
......
...@@ -19,7 +19,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -19,7 +19,7 @@ import org.springframework.web.client.RestTemplate;
}) })
public class WksServiceApplication { public class WksServiceApplication {
private final static Logger LOGGER = LoggerFactory.getLogger(SchemaService.class); private final static Logger LOGGER = LoggerFactory.getLogger(WksServiceApplication.class);
public static void main(String[] args) { public static void main(String[] args) {
ApplicationContext context = SpringApplication.run(WksServiceApplication.class, args); ApplicationContext context = SpringApplication.run(WksServiceApplication.class, args);
try { try {
......
...@@ -159,7 +159,7 @@ public class WKSServiceImpl implements WKSService { ...@@ -159,7 +159,7 @@ public class WKSServiceImpl implements WKSService {
LOGGER.warn(Constants.TRANFORMATION_FAILED, rawRecord.getId(), e.getErrorMsg(), e); LOGGER.warn(Constants.TRANFORMATION_FAILED, rawRecord.getId(), e.getErrorMsg(), e);
} }
catch (Exception e) { catch (Exception e) {
LOGGER.info(Constants.TRANFORMATION_FAILED, rawRecord.getId(), e.getMessage(), e); LOGGER.warn(Constants.TRANFORMATION_FAILED, rawRecord.getId(), e.getMessage(), e);
} }
} }
......
...@@ -107,7 +107,7 @@ public class RelationshipBlockHandler { ...@@ -107,7 +107,7 @@ public class RelationshipBlockHandler {
try { try {
wksRelationship = getRelationshipBlockWithWksIds(rawRelationship); wksRelationship = getRelationshipBlockWithWksIds(rawRelationship);
} catch (ApplicationException e) { } catch (ApplicationException e) {
LOGGER.info(e.getMessage(), e); LOGGER.warn(e.getMessage(), e);
} }
if(wksRelationship != null) { if(wksRelationship != null) {
wksRelationships.add(wksRelationship); wksRelationships.add(wksRelationship);
...@@ -143,7 +143,7 @@ public class RelationshipBlockHandler { ...@@ -143,7 +143,7 @@ public class RelationshipBlockHandler {
LOGGER.info("Querying search service for records having {} in ancestry", rawId); LOGGER.info("Querying search service for records having {} in ancestry", rawId);
searchResults = searchService.query(searchRequestPayload.getJsonString()); searchResults = searchService.query(searchRequestPayload.getJsonString());
} catch(ApplicationException e) { } catch(ApplicationException e) {
LOGGER.info("WKS not found from search service", e); LOGGER.warn("WKS not found from search service", e);
} }
Kind rawKind = new Kind(JsonTreeUtil.toTree(rawRecordJson).get("kind").asString()); Kind rawKind = new Kind(JsonTreeUtil.toTree(rawRecordJson).get("kind").asString());
......
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