private LensErrorTO buildLensErrorTO(final ErrorCollection errorCollection, final LensError lensError) { formattedErrorMsg = getFormattedErrorMsg(lensError); final String stackTrace = getStackTraceString(); return buildLensErrorTO(errorCollection, formattedErrorMsg, stackTrace); }
private LensErrorTO buildLensErrorTO(final ErrorCollection errorCollection, final LensError lensError) { formattedErrorMsg = getFormattedErrorMsg(lensError); final String stackTrace = getStackTraceString(); return buildLensErrorTO(errorCollection, formattedErrorMsg, stackTrace); }
static PruneCauses.BriefAndDetailedError extractPruneCause(LensException e) throws ClassNotFoundException { try { ErrorCollection errorCollection = new ErrorCollectionFactory().createErrorCollection(); final LensError lensError = errorCollection.getLensError(e.getErrorCode()); return new ObjectMapper().readValue( e.getFormattedErrorMsg(lensError).substring(e.getFormattedErrorMsg(lensError) .indexOf("{"), e.getFormattedErrorMsg(lensError).length()), new TypeReference<PruneCauses.BriefAndDetailedError>() {}); } catch (IOException e1) { throw new RuntimeException("!!!"); } }
protected String getLensExceptionErrorMessageInRewrite(String query, Configuration conf) throws LensException, ParseException, ClassNotFoundException { try { String hql = rewrite(query, conf); Assert.fail("Should have thrown exception. But rewrote the query : " + hql); // unreachable return null; } catch (LensException e) { ErrorCollection errorCollection = new ErrorCollectionFactory().createErrorCollection(); final LensError lensError = errorCollection.getLensError(e.getErrorCode()); log.error("Lens exception in Rewrite.", e); return e.getFormattedErrorMsg(lensError); } }