[
https://issues.apache.org/jira/browse/TAJO-1670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632664#comment-14632664
]
ASF GitHub Bot commented on TAJO-1670:
--------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/621#discussion_r34954062
--- Diff:
tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/AbstractCatalogClient.java
---
@@ -574,25 +652,26 @@ public final FunctionDesc getFunction(final String
signature, FunctionType funcT
builder.addParameterTypes(type);
}
- FunctionDescProto descProto = null;
+ FunctionDescResponse response = null;
try {
- CatalogProtocolService.BlockingInterface stub = getStub();
- descProto = stub.getFunctionMeta(null, builder.build());
- } catch (NoSuchFunctionException e) {
- LOG.debug(e.getMessage());
- } catch (ServiceException e) {
- LOG.error(e.getMessage(), e);
+ final BlockingInterface stub = getStub();
+ response = stub.getFunctionMeta(null, builder.build());
+ } catch (ServiceException se) {
+ throw new RuntimeException(se);
}
- if (descProto == null) {
- throw new NoSuchFunctionException(signature, paramTypes);
+ if (isThisError(response.getState(), ResultCode.UNDEFINED_FUNCTION)) {
+ throw new UndefinedFunctionException(signature, paramTypes);
+ } else if (isThisError(response.getState(),
ResultCode.AMBIGUOUS_FUNCTION)) {
--- End diff --
ResultCode seems to be DUPLICATE_FUNCTION
> Refactor client errors and exceptions
> -------------------------------------
>
> Key: TAJO-1670
> URL: https://issues.apache.org/jira/browse/TAJO-1670
> Project: Tajo
> Issue Type: Sub-task
> Components: Java Client, TajoMaster, Worker
> Reporter: Hyunsik Choi
> Assignee: Hyunsik Choi
> Fix For: 0.11.0
>
>
> The main objective is to refactor the error and exception system in client
> side and its connected parts like TajoMaster.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)