if(!StringUtil.isEmpty(msg, true)) {
String detail=Caster.toString(sct.get(KeyConstants._detail,null),null);
String errCode=Caster.toString(sct.get("ErrorCode",null),null);
String extInfo=Caster.toString(sct.get("ExtendedInfo",null),null);
PageException pe=null;
if("application".equalsIgnoreCase(type))
pe = new ApplicationException(msg, detail);
else if("expression".equalsIgnoreCase(type))
pe = new ExpressionException(msg, detail);
else
pe=new CustomTypeException(msg, detail, errCode, type, extInfo);
// Extended Info
if(!StringUtil.isEmpty(extInfo,true))pe.setExtendedInfo(extInfo);
// Error Code
if(!StringUtil.isEmpty(errCode,true))pe.setErrorCode(errCode);
// Additional
if(pe instanceof PageExceptionImpl) {
PageExceptionImpl pei=(PageExceptionImpl) pe;
sct=Caster.toStruct(sct.get("additional",null),null);