mirror of
https://github.com/microsoft/playwright-java.git
synced 2026-02-12 16:34:29 +00:00
fix: do not fail on a bad file name in stack trace (#1120)
This commit is contained in:
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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user