Skip to content

Commit

Permalink
Catch RuntimeException and log normal exception
Browse files Browse the repository at this point in the history
Catch RuntimeException and log normal exception

FB not happy
  • Loading branch information
sanderv32 committed Feb 12, 2017
1 parent 1057506 commit 72928ba
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ associated documentation files (the "Software"), to deal in the Software without

package org.jenkinsci.plugins.gogs;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -103,7 +105,13 @@ public GogsResults triggerJobs(String jobName, String deliveryID) {
LOGGER.warning(msg);
}
}
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
LOGGER.severe(sw.toString());
} finally {
SecurityContextHolder.setContext(saveCtx);
}
Expand Down

0 comments on commit 72928ba

Please sign in to comment.