Skip to content

Commit

Permalink
Better logging for exceptions from webrunner commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jogu committed Jul 28, 2018
1 parent 3a3e7b4 commit 8b2ba55
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -15,6 +15,7 @@
package io.fintechlabs.testframework.frontChannel;

import static io.fintechlabs.testframework.logging.EventLog.args;
import static io.fintechlabs.testframework.logging.EventLog.ex;

import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -322,8 +323,10 @@ public void run() {
urlVisited(url);
} catch (Exception e) {
logger.error("WebRunner caught exception", e);
eventLog.log("WebRunner", args("msg", e.getMessage(), "pageSource", driver.getPageSource(),
"contentType", driver.getResponseContentType(), "result", ConditionResult.FAILURE));
eventLog.log("WebRunner",
ex(e,
args("msg", e.getMessage(), "page_source", driver.getPageSource(),
"content_type", driver.getResponseContentType(), "result", ConditionResult.FAILURE)));
// note that this leaves us in the current list of runners for the executing test
this.lastException = e.getMessage();
throw new TestFailureException(testId, "Web Runner Exception: " + e.getMessage());
Expand Down

0 comments on commit 8b2ba55

Please sign in to comment.