public final LensErrorTO buildLensErrorTO(final ErrorCollection errorCollection) { final LensError lensError = errorCollection.getLensError(getErrorCode()); return buildLensErrorTO(errorCollection, lensError); }
public final LensErrorTO buildLensErrorTO(final ErrorCollection errorCollection) { final LensError lensError = errorCollection.getLensError(getErrorCode()); return buildLensErrorTO(errorCollection, lensError); }
public final void buildLensErrorResponse(final ErrorCollection errorCollection, final String apiVersion, final String id) { final LensError lensError = errorCollection.getLensError(getErrorCode()); final LensErrorTO lensErrorTO = buildLensErrorTO(errorCollection, lensError); lensAPIResult = LensAPIResult.composedOf(apiVersion, id, lensErrorTO, lensError.getHttpStatusCode()); }
public final void buildLensErrorResponse(final ErrorCollection errorCollection, final String apiVersion, final String id) { final LensError lensError = errorCollection.getLensError(getErrorCode()); final LensErrorTO lensErrorTO = buildLensErrorTO(errorCollection, lensError); lensAPIResult = LensAPIResult.composedOf(apiVersion, id, lensErrorTO, lensError.getHttpStatusCode()); }
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); } }