Skip to content

Commit 999a744

Browse files
dima-grouponandreastt
authored andcommitted
Log stacktrace
Adds more info on catch to be put into the log instead of just console. This will help debug issues when one has access to grid hub log but no access to console. Removes now superfluous t.printStackTrace(). Signed-off-by: Andreas Tolfsen <[email protected]>
1 parent b780116 commit 999a744

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: java/server/src/org/openqa/grid/internal/TestSlot.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
package org.openqa.grid.internal;
1818

19+
import com.google.common.base.Throwables;
20+
1921
import org.openqa.grid.common.SeleniumProtocol;
2022
import org.openqa.grid.common.exception.GridException;
2123
import org.openqa.grid.internal.listeners.TestSessionListener;
@@ -219,8 +221,9 @@ boolean performAfterSessionEvent() {
219221
((TestSessionListener) proxy).afterSession(currentSession);
220222
}
221223
} catch (Throwable t) {
222-
log.severe("Error running afterSession for " + currentSession + " the test slot is now dead.");
223-
t.printStackTrace();
224+
log.severe(String.format(
225+
"Error running afterSession for %s, the test slot is now dead: %s\n%s", currentSession,
226+
t.getMessage(), Throwables.getStackTraceAsString(t)));
224227
return false;
225228
}
226229
return true;

0 commit comments

Comments
 (0)