Skip to content

Commit

Permalink
improved logging after error
Browse files Browse the repository at this point in the history
  • Loading branch information
rdk committed Apr 1, 2020
1 parent 49eb5d2 commit 3e5b596
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/groovy/cz/siret/prank/program/Main.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class Main implements Parametrized, Writable {
main = new Main(parsedArgs)
error = main.run()

} catch (Exception e) {
} catch (Throwable e) {

error = true

Expand All @@ -394,8 +394,12 @@ class Main implements Parametrized, Writable {
writeError e.getMessage(), e // on unknown exception also print stack trace
}

if (main!=null && main.logManager.loggingToFile) {
write "For details see log file: $main.logManager.logFile"
if (main!=null) {
String logLocation = "$main.installDir/log/prank.log"
if (main.logManager.loggingToFile) {
logLocation = main.logManager.logFile
}
write "For details see log file: $logLocation"
}

}
Expand Down

0 comments on commit 3e5b596

Please sign in to comment.