Skip to content

Commit 72928ba

Browse files
committed
Catch RuntimeException and log normal exception
Catch RuntimeException and log normal exception FB not happy
1 parent 1057506 commit 72928ba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/jenkinsci/plugins/gogs/GogsPayloadProcessor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ associated documentation files (the "Software"), to deal in the Software without
2323

2424
package org.jenkinsci.plugins.gogs;
2525

26+
import java.io.PrintWriter;
27+
import java.io.StringWriter;
2628
import java.util.ArrayList;
2729
import java.util.HashMap;
2830
import java.util.List;
@@ -103,7 +105,13 @@ public GogsResults triggerJobs(String jobName, String deliveryID) {
103105
LOGGER.warning(msg);
104106
}
105107
}
108+
} catch (RuntimeException e) {
109+
throw e;
106110
} catch (Exception e) {
111+
StringWriter sw = new StringWriter();
112+
PrintWriter pw = new PrintWriter(sw);
113+
e.printStackTrace(pw);
114+
LOGGER.severe(sw.toString());
107115
} finally {
108116
SecurityContextHolder.setContext(saveCtx);
109117
}

0 commit comments

Comments
 (0)