/** * It can throw any TajoException if any error occurs. * * @param state * @throws TajoException */ public static void throwIfError(ReturnState state) throws TajoException { if (isError(state)) { throw toTajoException(state); } }
/** * It can throw any TajoException if any error occurs. * * @param state * @throws TajoException */ public static void throwIfError(ReturnState state) throws TajoException { if (isError(state)) { throw toTajoException(state); } }
public TajoRuntimeException(ReturnState state) { super(ExceptionUtil.toTajoException(state)); this.code = state.getReturnCode(); }
public TajoRuntimeException(ReturnState state) { super(ExceptionUtil.toTajoException(state)); this.code = state.getReturnCode(); }
/** * If the exception is equivalent to the error corresponding to the expected exception, throws the exception. * It is used to throw an exception for a error. * * @param state ReturnState * @param clazz Exception class corresponding to the expected * @param <T> Exception class * @throws T Exception */ public static <T extends TajoException> void throwsIfThisError(ReturnState state, Class<T> clazz) throws T { if (isError(state)) { T exception = (T) toTajoException(state); if (exception.getClass().equals(clazz)) { throw exception; } } }
/** * If the exception is equivalent to the error corresponding to the expected exception, throws the exception. * It is used to throw an exception for a error. * * @param state ReturnState * @param clazz Exception class corresponding to the expected * @param <T> Exception class * @throws T Exception */ public static <T extends TajoException> void throwsIfThisError(ReturnState state, Class<T> clazz) throws T { if (isError(state)) { T exception = (T) toTajoException(state); if (exception.getClass().equals(clazz)) { throw exception; } } }
public TajoSQLException(PrimitiveProtos.ReturnState returnState) { super(returnState.getMessage(), SQLExceptionUtil.toSQLState(returnState.getReturnCode()), ExceptionUtil.toTajoException(returnState)); }
public TajoSQLException(PrimitiveProtos.ReturnState returnState) { super(returnState.getMessage(), SQLExceptionUtil.toSQLState(returnState.getReturnCode()), ExceptionUtil.toTajoException(returnState)); }
public TajoRuntimeException(ResultCode code, String ... args) { super( ExceptionUtil.toTajoException( ReturnState.newBuilder() .setReturnCode(code) .setMessage(ErrorMessages.getMessage(code, args)) .build() ) ); this.code = code; }
public TajoRuntimeException(ResultCode code, String ... args) { super( ExceptionUtil.toTajoException( ReturnState.newBuilder() .setReturnCode(code) .setMessage(ErrorMessages.getMessage(code, args)) .build() ) ); this.code = code; }