diff --git a/src/main/java/com/eactive/eai/adapter/handler/TemplateAdapterErrorMsgHandler.java b/src/main/java/com/eactive/eai/adapter/handler/TemplateAdapterErrorMsgHandler.java index 589221f..a12e5da 100644 --- a/src/main/java/com/eactive/eai/adapter/handler/TemplateAdapterErrorMsgHandler.java +++ b/src/main/java/com/eactive/eai/adapter/handler/TemplateAdapterErrorMsgHandler.java @@ -411,9 +411,16 @@ public class TemplateAdapterErrorMsgHandler implements AdapterErrorMessageHandle @Override public Object generateNonStandardInternalErrorResponseMessage(String inboudnAdapterGroupName, String inboudnAdapterName, Properties callProp, Object inboundRequestData, EAIMessage resEaiMsg) throws Exception { - String templateKey = inboudnAdapterGroupName + ".sys.template"; - String template = PropManager.getInstance().getProperty(PROP_GROUP, templateKey); - + String template = ""; + String templateKey = ""; + if (resEaiMsg != null && StringUtils.isNotEmpty(resEaiMsg.getRspErrCd())) { + templateKey = inboudnAdapterGroupName + ".sys." + resEaiMsg.getRspErrCd() + ".template"; + template = PropManager.getInstance().getProperty(PROP_GROUP, templateKey); + } + if (StringUtils.isBlank(template)) { + templateKey = inboudnAdapterGroupName + ".sys.template"; + template = PropManager.getInstance().getProperty(PROP_GROUP, templateKey); + } if (StringUtils.isBlank(template)) template = PropManager.getInstance().getProperty(PROP_GROUP, "default.sys.template");