SUPPORT-8974 ???
This commit is contained in:
parent
490bc9bb5e
commit
439d5ab2a2
5 changed files with 23 additions and 11 deletions
|
|
@ -1,8 +1,17 @@
|
|||
package ru.micord.ervu_eks.exception;
|
||||
|
||||
public class ConfigExecutorException extends RuntimeException{
|
||||
import org.springframework.context.support.MessageSourceAccessor;
|
||||
import ru.cg.webbpm.modules.core.runtime.api.LocalizedException;
|
||||
import ru.cg.webbpm.modules.core.runtime.api.MessageBundleUtils;
|
||||
|
||||
public ConfigExecutorException(String message) {
|
||||
super(message);
|
||||
public class ConfigExecutorException extends LocalizedException {
|
||||
|
||||
private static final MessageSourceAccessor MESSAGE_SOURCE = MessageBundleUtils.createAccessor(
|
||||
"i18n/exception_handler_messages"
|
||||
);
|
||||
|
||||
public ConfigExecutorException(String code, Throwable cause) {
|
||||
super(code, MESSAGE_SOURCE, cause);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,10 +95,7 @@ public class ConfigExecutorService {
|
|||
}.getType()
|
||||
);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String> details = (Map<String, String>) responseMap.get("details");
|
||||
String detailsStr = String.join("\n", details.values());
|
||||
throw new ConfigExecutorException(detailsStr);
|
||||
throw new ConfigExecutorException((String) responseMap.get("details"), e);
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException(
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
error.unknown=Произошла неизвестная ошибка, обратитесь в службу технической поддержки!
|
||||
error.unknown=Произошла неизвестная ошибка, обратитесь в службу технической поддержки
|
||||
eks.error.argument.missing=Произошла ошибка ввода данных. Проверьте заполненность полей
|
||||
eks.error.argument.invalid=Произошла ошибка ввода данных. Проверьте корректность данных
|
||||
eks.error.misc=Произошла неизвестная ошибка, обратитесь в службу технической поддержки
|
||||
|
|
@ -1 +1,4 @@
|
|||
error.unknown=Unknown error, please contact technical support service.
|
||||
error.unknown=Unknown error, please contact technical support service.
|
||||
eks.error.argument.missing=Validation error: some arguments are missing
|
||||
eks.error.argument.invalid=Validation error: some arguments are invalid
|
||||
eks.error.misc=Ïðîèçîøëà íåèçâåñòíàÿ îøèáêà, îáðàòèòåñü â ñëóæáó òåõíè÷åñêîé ïîääåðæêè
|
||||
|
|
@ -114,7 +114,7 @@ public class ValidationService {
|
|||
}
|
||||
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
throw new IllegalRequestParametersException("пустые идентификаторы не допускаются");
|
||||
throw new IllegalRequestParametersException("eks.error.argument.missing");
|
||||
}
|
||||
|
||||
Boolean isIdsFormatted = request.getRequestValidationRules().getIsIdsFormatted();
|
||||
|
|
@ -124,7 +124,7 @@ public class ValidationService {
|
|||
boolean invalidIdFound = ids.stream().anyMatch(id -> !id.matches(uuidRegex));
|
||||
|
||||
if (invalidIdFound) {
|
||||
throw new IllegalRequestParametersException("Некоторые идентификаторы не соответствуют формату GUID");
|
||||
throw new IllegalRequestParametersException("eks.error.argument.invalid");
|
||||
}
|
||||
}
|
||||
return Map.of(ValidationService.IS_EMPTY_IDS_ALLOWED, emptyIdsAllowed);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue