protected void throwComplaintTypeErrorIfSpecified(Error actualError) { if (complaintType != null) { throw Complaint.from(complaintType, complaintDetails, actualError); } }
protected void throwComplaintTypeErrorIfSpecified(Error actualError) { if (complaintType != null) { LOGGER.error("Could not resolve question", actualError); throw Complaint.from(complaintType, complaintDetails, actualError); } }
public static Error from(Class<? extends Error> complaintType, String complaintDetails, Error actualError) { if ((complaintDetails == null) && (actualError.getMessage() == null)) { return from(complaintType, actualError); } complaintDetails = errorMessageFrom(complaintDetails, actualError); try { return complaintType.getConstructor(String.class, Throwable.class).newInstance(complaintDetails, actualError); } catch (Exception e) { return new AssertionError(String.format(NO_VALID_CONSTRUCTOR, complaintType.getSimpleName())); } }
private void throwDiagosticErrorIfProvided(Error actualError) { if (question instanceof QuestionDiagnostics) { throw Complaint.from(((QuestionDiagnostics) question).onError(), actualError); } }
private void throwDiagosticErrorIfProvided(Error actualError) { if (question instanceof QuestionDiagnostics) { throw Complaint.from(((QuestionDiagnostics) question).onError(), actualError); } }
private void throwDiagosticErrorIfProvided(Error actualError) { if (question instanceof QuestionDiagnostics) { throw Complaint.from(((QuestionDiagnostics) question).onError(), actualError); } }
private void throwDiagosticErrorIfProvided(Error actualError) { if (question instanceof QuestionDiagnostics) { throw Complaint.from(((QuestionDiagnostics) question).onError(), actualError); } }
public static Error from(Class<? extends Error> complaintType, String complaintDetails, Error actualError) { if ((complaintDetails == null) && (actualError.getMessage() == null)) { return from(complaintType, actualError); } complaintDetails = errorMessageFrom(complaintDetails, actualError); try { return complaintType.getConstructor(String.class, Throwable.class).newInstance(complaintDetails, actualError); } catch (Exception e) { return new AssertionError(String.format(NO_VALID_CONSTRUCTOR, complaintType.getSimpleName())); } }