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 cd1edfe6..eb243464 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; 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 028444c0..db161077 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 @@ protected String doHttpRequest(String strURL, String method, String data) { 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) {