1
0
mirror of synced 2026-08-05 23:16:54 +00:00

fix: do not fail on a bad file name in stack trace (#1120)

This commit is contained in:
Yury Semikhatsky
2022-11-11 18:42:11 -08:00
committed by GitHub
parent 3cc198ea26
commit 1674f95bd1
@@ -69,7 +69,13 @@ class StackTraceCollector {
if (file == null) {
return "";
}
return resolveSourcePath(Paths.get(pkg).resolve(file));
try {
// The file name can contain an arbitrary string which may cause Path implementation
// to throw. See https://github.com/microsoft/playwright-java/issues/1115
return resolveSourcePath(Paths.get(pkg).resolve(file));
} catch (RuntimeException e) {
return "";
}
}
private String resolveSourcePath(Path relativePath) {