From d9cbd25e9134a914895733268024b1fe5734d0b3 Mon Sep 17 00:00:00 2001 From: pradithya aria Date: Thu, 31 Jan 2019 14:33:04 +0800 Subject: [PATCH] add logging when error on request feature (#117) --- core/src/main/java/feast/core/service/SpecService.java | 9 ++++----- .../test/java/feast/core/service/SpecServiceTest.java | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/feast/core/service/SpecService.java b/core/src/main/java/feast/core/service/SpecService.java index c7c663092d..bded3399ef 100644 --- a/core/src/main/java/feast/core/service/SpecService.java +++ b/core/src/main/java/feast/core/service/SpecService.java @@ -90,7 +90,7 @@ public List getEntities(List ids) { List entityInfos = this.entityInfoRepository.findAllById(dedupIds); if (entityInfos.size() < dedupIds.size()) { throw new RetrievalException( - "unable to retrieve all entities requested"); // TODO: check and return exactly which ones + "unable to retrieve all entities requested " + ids); } return entityInfos; } @@ -122,7 +122,7 @@ public List getFeatures(List ids) { List featureInfos = this.featureInfoRepository.findAllById(dedupIds); if (featureInfos.size() < dedupIds.size()) { throw new RetrievalException( - "unable to retrieve all features requested"); // TODO: check and return exactly which ones + "unable to retrieve all features requested: " + ids); } return featureInfos; } @@ -154,8 +154,7 @@ public List getFeatureGroups(List ids) { List featureGroupInfos = this.featureGroupInfoRepository.findAllById(dedupIds); if (featureGroupInfos.size() < dedupIds.size()) { throw new RetrievalException( - "unable to retrieve all feature groups requested"); // TODO: check and return exactly - // which ones + "unable to retrieve all feature groups requested " + dedupIds); } return featureGroupInfos; } @@ -187,7 +186,7 @@ public List getStorage(List ids) { List storageInfos = this.storageInfoRepository.findAllById(dedupIds); if (storageInfos.size() < dedupIds.size()) { throw new RetrievalException( - "unable to retrieve all storage requested"); // TODO: check and return exactly which ones + "unable to retrieve all storage requested: " + ids); } return storageInfos; } diff --git a/core/src/test/java/feast/core/service/SpecServiceTest.java b/core/src/test/java/feast/core/service/SpecServiceTest.java index d4af688750..43f1450f7b 100644 --- a/core/src/test/java/feast/core/service/SpecServiceTest.java +++ b/core/src/test/java/feast/core/service/SpecServiceTest.java @@ -227,7 +227,7 @@ public void shouldThrowRetrievalExceptionIfAnyFeatureNotFound() { featureGroupInfoRepository, schemaManager); exception.expect(RetrievalException.class); - exception.expectMessage("unable to retrieve all features requested"); + exception.expectMessage("unable to retrieve all features requested: " + ids); specService.getFeatures(ids); } @@ -304,7 +304,7 @@ public void shouldThrowRetrievalExceptionIfAnyStorageNotFound() { schemaManager); exception.expect(RetrievalException.class); - exception.expectMessage("unable to retrieve all storage requested"); + exception.expectMessage("unable to retrieve all storage requested: " + ids); specService.getStorage(ids); }