Repository: sqoop Updated Branches: refs/heads/sqoop2 423de5d51 -> 51dd8375f
SQOOP-1748: Sqoop2: Client throws NPE when misconfigured for Kerberos (Richard Zhou via Abraham Elmahrek) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/51dd8375 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/51dd8375 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/51dd8375 Branch: refs/heads/sqoop2 Commit: 51dd8375f3bc14543cef992cc6c60040ca33127a Parents: 423de5d Author: Abraham Elmahrek <[email protected]> Authored: Mon Nov 17 21:30:49 2014 -0800 Committer: Abraham Elmahrek <[email protected]> Committed: Mon Nov 17 21:30:49 2014 -0800 ---------------------------------------------------------------------- client/src/main/java/org/apache/sqoop/client/ClientError.java | 3 +++ .../java/org/apache/sqoop/client/request/ResourceRequest.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/51dd8375/client/src/main/java/org/apache/sqoop/client/ClientError.java ---------------------------------------------------------------------- diff --git a/client/src/main/java/org/apache/sqoop/client/ClientError.java b/client/src/main/java/org/apache/sqoop/client/ClientError.java index cd1edfe..eb24346 100644 --- a/client/src/main/java/org/apache/sqoop/client/ClientError.java +++ b/client/src/main/java/org/apache/sqoop/client/ClientError.java @@ -32,6 +32,9 @@ public enum ClientError implements ErrorCode { /** Given connector is not known to the server **/ CLIENT_0003("Connector do not exists"), + + /** The system was not able to find valid Kerberos tikcet cache (kinit). */ + CLIENT_0004("Unable to find valid Kerberos ticket cache (kinit)"); ; private final String message; http://git-wip-us.apache.org/repos/asf/sqoop/blob/51dd8375/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java ---------------------------------------------------------------------- diff --git a/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java b/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java index 028444c..db16107 100644 --- a/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java +++ b/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java @@ -114,14 +114,16 @@ public class ResourceRequest { throw new SqoopException(ClientError.CLIENT_0001, ex.getThrowable()); } + } else { + throw new SqoopException(ClientError.CLIENT_0000); } return result.toString(); } catch (IOException ex) { LOG.trace("ERROR: ", ex); - return ""; + throw new SqoopException(ClientError.CLIENT_0000, ex); } catch (AuthenticationException ex) { LOG.trace("ERROR: ", ex); - return ""; + throw new SqoopException(ClientError.CLIENT_0004, ex); } finally { try { if (wr != null) {
