From 7232b34316344d81094a75fa6f02dc5fb42046e8 Mon Sep 17 00:00:00 2001 From: Lekha Thota Date: Tue, 19 May 2015 22:31:51 +0000 Subject: [PATCH] Change HCatalog Get Column error for Non-existent columns from Server Error(500) to Not Found error (404) --- .../hive/hcatalog/templeton/HcatDelegator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java index cd9128e..8a4758c 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java @@ -766,7 +766,7 @@ public Response descOneColumn(String user, String db, String table, String colum Object o = res.getEntity(); final Map fields = (o != null && (o instanceof Map)) ? (Map) o : null; if (fields == null) - throw new SimpleWebException(HttpStatus.INTERNAL_SERVER_ERROR_500, "Internal error, unable to find column " + throw new SimpleWebException(HttpStatus.NOT_FOUND_404, "Internal error, unable to find column " + column); @@ -781,7 +781,7 @@ public Response descOneColumn(String user, String db, String table, String colum } } if (found == null) - throw new SimpleWebException(HttpStatus.INTERNAL_SERVER_ERROR_500, "unable to find column " + column, + throw new SimpleWebException(HttpStatus.NOT_FOUND_404, "unable to find column " + column, new HashMap() { { put("description", fields); -- 1.7.9.5