Atitit. atiJavaExConverter4js  新的特性

本文介绍了一种将Java异常转换为JavaScript可处理格式的方法,并提供了详细的实现代码。此外,还探讨了如何通过Ajax捕获异常及使用特定库来实现Try-Catch功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.youkuaiyun.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;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值