Atitti The translation of cross-language exceptions throws Java JS
The conversion of the exception is directly deserialized into the JSON object e object.
Js, there is no complete e- mechanism, you can refer to Java Implementation of a stack hierarchy mechanism of e object can be:
throws runtimeexception vs or e.cause;
The full e should be thrown because Runtimee may have some notes:
How to catch the exception, you can judge, if it is runtimeexception, then capture his cause can be.
function Convert2jsex (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")
{
throw data.cause;
}
else if (data["@type"]!=null && data["@type"]== "Java.lang.Exception")
{
Throw data.cause;
}
else if (data["StackTrace"]!=null)
{
throw data;
}
else if (data["Xdebug_message"]!=null)
{
if (data.xdebug_message!=null)
LOGX (data.xdebug_message);
throw data.xdebug_message;
}
Else
return false;
}
author:: Nickname :Old Wow's claws( Full Name::AttilaxAkbar Al Rapanui Attilaksachanui)
Kanji Name: Etila ( Ayron) , email:[email protected]
reprint Please indicate source: http://www.cnblogs.com/attilax/
Atiend
Atitti the translation of cross-language exceptions throws Java JS