Logging only cause of Exception in case of ExecutionException.

(no futureTask, etc. in error logs)
This commit is contained in:
Jindra Petřík
2016-03-05 08:09:09 +01:00
parent 22d1047f47
commit a7390c083d
3 changed files with 22 additions and 14 deletions

View File

@@ -248,13 +248,19 @@ public class ScriptPack extends AS3ClassTreeItem {
}, timeout, TimeUnit.SECONDS);
} catch (TimeoutException ex) {
writer.continueMeasure();
logger.log(Level.SEVERE, "Decompilation error", ex);
logger.log(Level.SEVERE, "Decompilation timeout", ex);
Helper.appendTimeoutCommentAs3(writer, timeout, 0);
return;
} catch (ExecutionException ex) {
writer.continueMeasure();
logger.log(Level.SEVERE, "Decompilation error", ex);
Helper.appendErrorComment(writer, ex);
Exception convertException = ex;
Throwable cause = ex.getCause();
if (ex instanceof ExecutionException && cause instanceof Exception) {
convertException = (Exception) cause;
}
logger.log(Level.SEVERE, "Decompilation error", convertException);
Helper.appendErrorComment(writer, convertException);
return;
}
writer.continueMeasure();

View File

@@ -329,17 +329,18 @@ public final class MethodBody implements Cloneable {
} catch (InterruptedException ex) {
throw ex;
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
if (ex instanceof TimeoutException) {
logger.log(Level.SEVERE, "Decompilation timeout in: " + path, ex);
} else {
logger.log(Level.SEVERE, "Decompilation error in: " + path, ex);
}
convertException = ex;
Throwable cause = ex.getCause();
if (ex instanceof ExecutionException && cause instanceof Exception) {
convertException = (Exception) cause;
}
if (convertException instanceof TimeoutException) {
logger.log(Level.SEVERE, "Decompilation timeout in: " + path, convertException);
} else {
logger.log(Level.SEVERE, "Decompilation error in: " + path, convertException);
}
}
}
}

View File

@@ -858,17 +858,18 @@ public abstract class Action implements GraphSourceItem {
} catch (InterruptedException ex) {
throw ex;
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
if (ex instanceof TimeoutException) {
logger.log(Level.SEVERE, "Decompilation timeout in: " + path, ex);
} else {
logger.log(Level.SEVERE, "Decompilation error in: " + path, ex);
}
convertException = ex;
Throwable cause = ex.getCause();
if (ex instanceof ExecutionException && cause instanceof Exception) {
convertException = cause;
}
if (convertException instanceof TimeoutException) {
logger.log(Level.SEVERE, "Decompilation timeout in: " + path, convertException);
} else {
logger.log(Level.SEVERE, "Decompilation error in: " + path, convertException);
}
}
writer.continueMeasure();
@@ -1067,7 +1068,7 @@ public abstract class Action implements GraphSourceItem {
}
/*ActionJump && ActionIf removed*/
/*if ((action instanceof ActionEnumerate2) || (action instanceof ActionEnumerate)) {
/*if ((action instanceof ActionEnumerate2) || (action instanceof ActionEnumerate)) {
loopStart = ip + 1;
isForIn = true;
ip += 4;