Skip to content

Commit

Permalink
Better error code; clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPeck committed Jan 17, 2024
1 parent 19339d3 commit 244d587
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import edu.harvard.hms.dbmi.avillach.auth.service.auth.FENCEAuthenticationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -45,7 +46,7 @@ public class StudyAccessService {
@RolesAllowed(SUPER_ADMIN)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/")
public Response addStudyAccess(String studyIdentifier) {
public Response addStudyAccess(@ApiParam(value="The Study Identifier of the new study from the metadata.json") String studyIdentifier) {
if (StringUtils.isBlank(studyIdentifier)) {
return Response.status(Response.Status.BAD_REQUEST)
.entity("Study identifier cannot be blank")
Expand All @@ -66,7 +67,7 @@ public Response addStudyAccess(String studyIdentifier) {
}
if (fenceMappingForStudy == null || fenceMappingForStudy.isEmpty()) {
logger.error("addStudyAccess - Could not find study: " + studyIdentifier + " in FENCE mapping");
return Response.status(Response.Status.NOT_FOUND)
return Response.status(Response.Status.BAD_REQUEST)
.entity("Could not find study with the provided identifier")
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ public Response getFENCEProfile(String callback_url, Map<String, String> authReq

} catch (Exception ex) {
logger.error("getFENCEToken() Could not persist the user information, because "+ex.getMessage());
ex.printStackTrace();
throw new NotAuthorizedException("The user details could not be persisted. Please contact the administrator.");
}

Expand Down

0 comments on commit 244d587

Please sign in to comment.