public LensMultiCauseException(@NonNull final ImmutableList<LensException> excpList) { super(getAppropriateError(excpList)); this.causes = excpList; }
@Override protected LensErrorTO buildLensErrorTO(final ErrorCollection errorCollection, final String errorMsg, final String stackTrace) { return LensErrorTO.composedOf(getErrorCode(), errorMsg, stackTrace, null, getChildErrors(errorCollection)); }
protected List<LensErrorTO> getChildErrors(final ErrorCollection errorCollection) { List<LensErrorTO> childErrors = new LinkedList<LensErrorTO>(); for (LensException cause : getCauses()) { childErrors.add(cause.buildLensErrorTO(errorCollection)); } return childErrors; } }
for (LensException cause : causes) { if (!cause.equals(firstCause)) { throw new LensMultiCauseException(ImmutableList.copyOf(causes));
protected List<LensErrorTO> getChildErrors(final ErrorCollection errorCollection) { List<LensErrorTO> childErrors = new LinkedList<LensErrorTO>(); for (LensException cause : getCauses()) { childErrors.add(cause.buildLensErrorTO(errorCollection)); } return childErrors; } }
@Override protected LensErrorTO buildLensErrorTO(final ErrorCollection errorCollection, final String errorMsg, final String stackTrace) { return LensErrorTO.composedOf(getErrorCode(), errorMsg, stackTrace, null, getChildErrors(errorCollection)); }
public LensMultiCauseException(@NonNull final ImmutableList<LensException> excpList) { super(getAppropriateError(excpList)); this.causes = excpList; }