Skip to content

Commit

Permalink
Bug fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Ljupcho Palashevski <[email protected]>
  • Loading branch information
lpalashevski committed Sep 11, 2023
1 parent 01f1de1 commit e3a30e4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.odpi.openmetadata.accessservices.assetcatalog.model.AssetCatalogBean;
import org.odpi.openmetadata.accessservices.assetcatalog.model.Elements;
import org.odpi.openmetadata.accessservices.assetcatalog.model.rest.body.SearchParameters;
import org.odpi.openmetadata.accessservices.assetcatalog.model.rest.responses.AssetCatalogListResponse;
import org.odpi.openmetadata.accessservices.assetcatalog.model.rest.responses.AssetCatalogResponse;
import org.odpi.openmetadata.accessservices.assetcatalog.model.rest.responses.AssetCatalogSupportedTypes;
import org.odpi.openmetadata.accessservices.assetcatalog.model.rest.responses.AssetListResponse;
Expand Down Expand Up @@ -72,6 +71,8 @@ public AssetCatalogResponse getAssetDetailsByGUID(String serverName,
restExceptionHandler.captureUserNotAuthorizedException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}

log.debug(METHOD_WITH_RESPONSE, methodName, response);
Expand Down Expand Up @@ -109,6 +110,8 @@ public AssetCatalogResponse getAssetUniverseByGUID(String serverName,
restExceptionHandler.captureUserNotAuthorizedException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}

log.debug(METHOD_WITH_RESPONSE, methodName, response);
Expand Down Expand Up @@ -145,6 +148,8 @@ public ClassificationListResponse getClassificationByAssetGUID(String serverName
restExceptionHandler.captureUserNotAuthorizedException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}

log.debug(METHOD_WITH_RESPONSE, methodName, response);
Expand Down Expand Up @@ -185,6 +190,8 @@ public RelationshipListResponse getAssetRelationships(String serverName,
restExceptionHandler.captureInvalidParameterException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}

log.debug(METHOD_WITH_RESPONSE, methodName, response);
Expand Down Expand Up @@ -229,6 +236,8 @@ public AssetListResponse searchByType(String serverName,
restExceptionHandler.captureInvalidParameterException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}

log.debug(METHOD_WITH_RESPONSE, methodName, response);
Expand Down Expand Up @@ -272,6 +281,8 @@ public AssetListResponse searchByTypeName(String serverName,
restExceptionHandler.captureInvalidParameterException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}

log.debug(METHOD_WITH_RESPONSE, methodName, response);
Expand Down Expand Up @@ -315,6 +326,8 @@ public AssetListResponse searchByTypeGUID(String serverName,
restExceptionHandler.captureInvalidParameterException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}

log.debug(METHOD_WITH_RESPONSE, methodName, response);
Expand Down Expand Up @@ -354,6 +367,8 @@ public AssetResponse buildContext(String serverName,
restExceptionHandler.captureInvalidParameterException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}
log.debug(METHOD_WITH_RESPONSE, methodName, response);

Expand Down Expand Up @@ -386,6 +401,8 @@ public AssetCatalogSupportedTypes getSupportedTypes(String serverName,
restExceptionHandler.captureInvalidParameterException(response, e);
} catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}

log.debug(METHOD_WITH_RESPONSE, methodName, response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public GUIDListResponse publishEntities(String serverName, String userId, String
restExceptionHandler.captureUserNotAuthorizedException(response, e);
} catch (PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName);
}
return response;
}
Expand Down Expand Up @@ -173,9 +175,9 @@ public GUIDListResponse publishEntity(String serverName, String userId, String e
GUIDListResponse response = new GUIDListResponse();

String methodName = "publishEntity";

AuditLog auditLog = null;
try {
AuditLog auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
HandlerHelper handlerHelper = instanceHandler.getHandlerHelper(userId, serverName, methodName);
EntityDetail entity = handlerHelper.getEntityDetails(userId, guid, entityType);
if (entity == null) {
Expand All @@ -195,6 +197,8 @@ public GUIDListResponse publishEntity(String serverName, String userId, String e
restExceptionHandler.captureUserNotAuthorizedException(response, e);
} catch (PropertyServerException e) {
restExceptionHandler.capturePropertyServerException(response, e);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName, auditLog);
}
return response;
}
Expand Down Expand Up @@ -294,6 +298,8 @@ public GUIDListResponse publishAssetContext(String serverName, String userId, St
restExceptionHandler.capturePropertyServerException(response, e);
} catch (OCFCheckedExceptionBase | JsonProcessingException e) {
restExceptionHandler.captureExceptions(response, e, methodName, auditLog);
} catch (Exception e) {
restExceptionHandler.captureExceptions(response, e, methodName, auditLog);
}
return response;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ logging.level.org.odpi.openmetadata=INFO
# Comma-separated list of origins.
# Example configuration below is for setting up local development environment where egeria-ui is hosted on one of the two urls.
# cors.allowed-origins=http://localhost,http://localhost:8081
cors.allowed-origins=
cors.allowed-origins=*

################################################
### Swagger Docs
Expand Down

0 comments on commit e3a30e4

Please sign in to comment.