Atitit. atiJavaExConverter4js  新的特性

Atitit. atiJavaExConverter4js  新的特性

 

 

1.1. V1新特性1

1.2. V2 新特性1

2Keyword1

3Catch1

4Convert n Throw ex2

5--atiex2

 

1.1. V1新特性

Java ex convert

1.2. V2 新特性

Catch 不同的ex

2. Keyword

Try catch的库方式实现

Ajaxerror catch

Ex.js

 

作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://blog.csdn.net/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;

}

原文地址:https://www.cnblogs.com/attilax/p/5963437.html