private void addError(String message) { // we always use the license field! errorCollection.addError(LICENSE_FIELD, message); }
if (StringUtils.isEmpty((versionName))) errors.addError("name", i18nBean.getText("admin.errors.enter.valid.version.name")); reasons.add(CreateVersionValidationResult.Reason.BAD_NAME); errors.addError("name", i18nBean.getText("admin.errors.version.already.exists")); reasons.add(CreateVersionValidationResult.Reason.DUPLICATE_NAME); errors.addError("name", i18nBean.getText("admin.errors.version.name.toolong")); reasons.add(CreateVersionValidationResult.Reason.VERSION_NAME_TOO_LONG);
errors.addError(ISSUE_LINKS, i18nHelper.getText("rest.operations.morethanone", String.valueOf(operations.size()), fieldId)); return errors;
@Override public void addErrors(Map<String, String> incomingErrors) { if (incomingErrors == null) { return; } for (final Map.Entry<String, String> mapEntry : incomingErrors.entrySet()) { addError(mapEntry.getKey(), mapEntry.getValue()); } }
@Override public void addError(String field, String message, Reason reason) { addError(field, message); addReason(reason); }
void addErrorKey(String fieldName, String key, String errorValue, ErrorCollection.Reason reason) { simpleErrorCollection.addError(fieldName, key, reason); if (errorCollection != null) { errorCollection.addError(fieldName, componentService.translateKeyToMessage(key, errorValue), reason); } }
public static ErrorCollectionMatcher hasError(final String fieldName, final String errorMessage) { SimpleErrorCollection errorCollection = new SimpleErrorCollection(); errorCollection.addError(fieldName, errorMessage); return new ErrorCollectionMatcher(errorCollection, false, false); }
public static ErrorCollectionMatcher hasOnlyError(final String fieldName, final String errorMessage) { SimpleErrorCollection errorCollection = new SimpleErrorCollection(); errorCollection.addError(fieldName, errorMessage); return new ErrorCollectionMatcher(errorCollection, false, true); }
private static Response forMessage(String key, String message, Response.Status status) { SimpleErrorCollection errorCollection = new SimpleErrorCollection(); errorCollection.addError(key, message); return build(Response.status(status) .entity(com.atlassian.jira.rest.api.util.ErrorCollection.of(errorCollection))); }
private <T> ServiceOutcome<T> generateErrorOutcomeFor(final String key, final String message) { final SimpleErrorCollection collection = new SimpleErrorCollection(); collection.addReason(ErrorCollection.Reason.VALIDATION_FAILED); collection.addError(key, message); return new ServiceOutcomeImpl<>(collection); }
ec.addError("name", i18nHelper.getText("admin.errors.must.specify.name")); ec.addError("name", i18nHelper.getText("admin.errors.status.length", MAX_STATUS_LENGTH)); if (existingStatus != null && (status == null || !existingStatus.getId().equals(status.getId()))) ec.addError("name", i18nHelper.getText("admin.errors.status.with.name.exists")); ec.addError("iconurl", i18nHelper.getText("admin.errors.must.specify.url.for.status.edit")); ec.addError("statusCategory", i18nHelper.getText("admin.errors.must.specify.status.category"));
public ErrorCollection validateInput(final CronEditorBean cronEditorBean, final String fieldName) { // TODO: If this grows then it should probably move into a validator object final I18nHelper i18n = authenticationContext.getI18nHelper(); final SimpleErrorCollection errors = new SimpleErrorCollection(); // Ensure that the user has selected at least one day of week if in the day of week mode if (cronEditorBean.isDayPerWeekMode() && StringUtils.isBlank(cronEditorBean.getSpecifiedDaysPerWeek())) { errors.addError(fieldName, i18n.getText("cron.editor.error.daysOfWeek.must.have.selection")); } // Ensure that if the user has set an hour range that the from is less than the to time if (cronEditorBean.isRange() && !cronEditorBean.isRangeHoursValid()) { errors.addError(fieldName, i18n.getText("cron.editor.error.from.hour.after.to.hour")); } return errors; }
simpleErrorCollection.addError("value", validatedApplicationProperty.getResult().getErrorMessage());
private ServiceOutcome<Date> parseDate(String fieldName, boolean set, Date date, String dateStr) { if (set) { return ServiceOutcomeImpl.ok(date); } if (StringUtils.isEmpty(dateStr)) { return ServiceOutcomeImpl.ok(null); } try { return ServiceOutcomeImpl.ok(dateFieldFormat.parseDatePicker(dateStr)); } catch (IllegalArgumentException exc) { final SimpleErrorCollection errorCollection = new SimpleErrorCollection(); errorCollection.addError(fieldName, i18n.getText("admin.errors.incorrect.date.format", dateFieldFormat.getFormatHint())); return ServiceOutcomeImpl.from(errorCollection, null); } }
errorCollection.addError(fieldName, i18n.getText("admin.errors.incorrect.date.format", dateFieldFormat.getFormatHint())); return ServiceOutcomeImpl.from(errorCollection, null);
for (AttachmentError error : convertResult.getErrors()) errors.addError(error.getFilename(), error.getLocalizedMessage(), error.getReason());
if (leadUser == null) errorCollection.addError("componentLead", i18n.getText("admin.projects.component.userdoesnotexist", leadUserName)); return;