Commit 51290693 by Diego Marino Monetti Committed by nixonrodrigues

ATLAS-3201:- Fix getByGuid in AtlasTypeRegistry, doesn't raise exception if guid invalid

parent 75ee78bf
...@@ -116,12 +116,14 @@ public class AtlasTypeRegistry { ...@@ -116,12 +116,14 @@ public class AtlasTypeRegistry {
return ret; return ret;
} }
public AtlasType getTypeByGuid(String guid) { public AtlasType getTypeByGuid(String guid) throws AtlasBaseException {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasTypeRegistry.getTypeByGuid({})", guid); LOG.debug("==> AtlasTypeRegistry.getTypeByGuid({})", guid);
} }
AtlasType ret = registryData.allTypes.getTypeByGuid(guid); AtlasType ret = registryData.allTypes.getTypeByGuid(guid);
if(ret == null)
throw new AtlasBaseException(AtlasErrorCode.TYPE_GUID_NOT_FOUND, guid);
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasTypeRegistry.getTypeByGuid({}): {}", guid, ret); LOG.debug("<== AtlasTypeRegistry.getTypeByGuid({}): {}", guid, ret);
......
Markdown is supported
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