mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-08 07:54:11 -08:00
js: fix extracting exception message from Java
This commit is contained in:
parent
6e90124edd
commit
b927b28e7d
|
@ -714,14 +714,18 @@ if (typeof Reflect === 'object') {
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
get: function() {
|
get: function() {
|
||||||
var javaException = this[$rt_javaExceptionProp];
|
try {
|
||||||
if (typeof javaException === 'object') {
|
var javaException = this[$rt_javaExceptionProp];
|
||||||
var javaMessage = $rt_throwableMessage(javaException);
|
if (typeof javaException === 'object') {
|
||||||
if (typeof javaMessage === "object") {
|
var javaMessage = $rt_throwableMessage(javaException);
|
||||||
return javaMessage.toString();
|
if (typeof javaMessage === "object") {
|
||||||
|
return javaMessage !== null ? javaMessage.toString() : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return this[defaultMessage];
|
||||||
|
} catch (e) {
|
||||||
|
return "Exception occurred trying to extract Java exception message: " + e
|
||||||
}
|
}
|
||||||
return this[defaultMessage];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user