Atitit. atiJavaExConverter4js 新的特性 1.1. V1新特性1 1.2. V2 新特性1 2. Keyword1 3. Catch1 4. Convert n Throw ex2 5. --atiex2 Java ex convert Catch 不同的ex Try c
Atitit. atiJavaExConverter4js 新的特性
1.1. V1新特性
Java ex convert
1.2. V2 新特性
Catch 不同的ex
2. Keyword
Try catch的庫方式實現
Ajax的error catch
Ex.js
作者:: 綽號:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿爾 拉帕努伊 ) 漢字名:艾龍, EMAIL:[email protected]
轉載請註明來源: http://www.cnblogs.com/attilax/
3. Catch
Ajax catch
window.onerror=function(errorMessage, scriptURI, lineNumber, columnNumber, error)
{
if(catchEx(error,"com.attilax.user.NotLoginEx"))
logx("not login");
else
logx("logined");
}
4. Convert n Throw ex
processJavaEx_V2q315(data);
5. --atiex
function processJavaEx_V2q315(data)
{
if(typeof data=="string")
{
try{
data = eval( "(" + data + ")" );
}catch(e)
{
//alert(e);
//yaosh puton str zeu return;
if(e instanceof ReferenceError)
return;
//return e;
}
}
if(data["@type"]!=null && data["@type"]=="java.lang.RuntimeException")
{
if(data.message!=null)
logx(data.message);
throw data.message;
}
if(data["@type"]!=null && data["@type"]=="java.lang.Exception")
{
if(data.message!=null)
logx(data.message);
throw data.message;
}
if(data["stackTrace"]!=null)
{
if(data.message!=null)
logx(data.message);
throw data;
}
if(data["xdebug_message"]!=null)
{
// if(data.xdebug_message!=null)
logx(data.xdebug_message);
throw data.xdebug_message;
}
else
return false;
}
function catchEx(e,exname)
{
if(e["@type"]==exname)
return true;
else
return false;
}