You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
973 B
37 lines
973 B
package com.fr.design.mainframe.vcs; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import java.io.IOException; |
|
import java.util.HashMap; |
|
|
|
/** |
|
* 版本管理异常处理工具类 |
|
* |
|
* @author Destiny.Lin |
|
* @since 11.0 |
|
* Created on 2023/7/24 |
|
*/ |
|
public class VcsExceptionUtils { |
|
|
|
public static final HashMap<Class, String> EXCEPTION_MAP = new HashMap<Class, String>() { |
|
{ |
|
put(IOException.class, Toolkit.i18nText("Fine-Design_Vcs_Exception_IO")); |
|
put(UnsupportedOperationException.class, Toolkit.i18nText("Fine-Design_Vcs_Exception_Un_Support")); |
|
} |
|
}; |
|
|
|
|
|
/** |
|
* 根据异常返回结果描述文案 |
|
*/ |
|
public static String createDetailByException(Exception e) { |
|
for (Class key : EXCEPTION_MAP.keySet()) { |
|
if (key.isAssignableFrom(e.getClass())) { |
|
return EXCEPTION_MAP.get(key); |
|
} |
|
} |
|
return Toolkit.i18nText("Fine-Design_Vcs_Exception_Unknown"); |
|
} |
|
|
|
}
|
|
|