yasithdev commented on code in PR #577:
URL: https://github.com/apache/airavata/pull/577#discussion_r2569789554
##########
airavata-api/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java:
##########
@@ -1781,28 +1323,25 @@ public ExperimentModel getExperiment(AuthzToken
authzToken, String airavataExper
gatewayId, userId + "@" + gatewayId,
airavataExperimentId, gatewayId + ":READ")) {
throw new AuthorizationException("User does not have
permission to access this resource");
}
- registryClientPool.returnResource(regClient);
sharingClientPool.returnResource(sharingClient);
return experimentModel;
} catch (Exception e) {
throw new AuthorizationException("User does not have
permission to access this resource");
}
} else {
- registryClientPool.returnResource(regClient);
sharingClientPool.returnResource(sharingClient);
return null;
}
- } catch (ExperimentNotFoundException e) {
- logger.error(e.getMessage(), e);
- registryClientPool.returnResource(regClient);
- sharingClientPool.returnResource(sharingClient);
- throw e;
} catch (Exception e) {
+ if (e instanceof ExperimentNotFoundException) {
Review Comment:
thanks! fixed this
##########
airavata-api/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java:
##########
@@ -2079,15 +1602,16 @@ public boolean validateExperiment(AuthzToken
authzToken, String airavataExperime
@Override
@SecurityCheck
public ExperimentStatus getExperimentStatus(AuthzToken authzToken, String
airavataExperimentId) throws TException {
- RegistryService.Client regClient = registryClientPool.getResource();
try {
- ExperimentStatus result =
regClient.getExperimentStatus(airavataExperimentId);
- registryClientPool.returnResource(regClient);
+ ExperimentStatus result =
airavataService.getExperimentStatus(airavataExperimentId);
return result;
+ } catch (org.apache.airavata.registry.cpi.RegistryException e) {
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setMessage(e.getMessage());
+ throw exception;
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]