File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
src/main/scala/codacy/dockerApi Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,18 @@ abstract class DockerEngine(Tool: Tool) {
46
46
}))
47
47
48
48
log(" tool started" )
49
- Tool (
50
- path = sourcePath,
51
- conf = maybePatterns,
52
- files = maybeFiles
53
- )
49
+ try {
50
+ Tool .apply(
51
+ path = sourcePath,
52
+ conf = maybePatterns,
53
+ files = maybeFiles
54
+ )
55
+ } catch {
56
+ // We need to catch Throwable here to avoid JVM crashes
57
+ // Crashes can lead to docker not exiting properly
58
+ case e : Throwable =>
59
+ Failure (e)
60
+ }
54
61
}
55
62
} match {
56
63
case Success (results) =>
@@ -67,7 +74,7 @@ abstract class DockerEngine(Tool: Tool) {
67
74
System .exit(0 )
68
75
case Failure (error) =>
69
76
error.printStackTrace(Console .err)
70
- System .exit (1 )
77
+ Runtime .getRuntime.halt (1 )
71
78
}
72
79
}
73
80
You can’t perform that action at this time.
0 commit comments