(1)加入新异常,调用外部程序异常。原外部程序调用异常提示在在返回信息
(2)音视频控制类异常处理,防止出现表单提交,审核时为了防止出现未知异常导致界面出错,catch MaatCovertException修改为catch exeption,根据异常类型进行判断返回界面信息 (3)message.tag不够严谨,修改了success的判断
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package com.nis.exceptions;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
|
||||
import com.nis.util.Configurations;
|
||||
|
||||
/**
|
||||
* 调用外部程序出错异常
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
public class CallExternalProceduresException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final String message=getMsgProp().getProperty("call_external_procedures_failed", "Call external procedures failed");
|
||||
public CallExternalProceduresException() {
|
||||
super(message);
|
||||
}
|
||||
public CallExternalProceduresException(String message) {
|
||||
super(message);
|
||||
|
||||
}
|
||||
public CallExternalProceduresException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取国际化配置文件
|
||||
* @return
|
||||
*/
|
||||
public static Properties getMsgProp(){
|
||||
Properties msgProp = new Properties();
|
||||
try {
|
||||
String language = LocaleContextHolder.getLocale().getLanguage();
|
||||
if(language.equals("zh_cn")||language.equals("zh")){
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_zh_CN.properties"));
|
||||
}else if(language.equals("ru")){
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_ru.properties"));
|
||||
}else{
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_en.properties"));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
msgProp = null;
|
||||
}
|
||||
return msgProp;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user