diff options
author | Florian Zschocke <f.zschocke+git@gmail.com> | 2022-11-11 12:14:55 +0100 |
---|---|---|
committer | Florian Zschocke <f.zschocke+git@gmail.com> | 2022-11-11 12:14:55 +0100 |
commit | 30abff544589292fbead49d2b04a96d604938eb0 (patch) | |
tree | 6df1ead92ddaebe9e479d70c3c1439eaa8aa5be3 | |
parent | d00bdf2feed0f0a2eefe437ab9dc1561f0049002 (diff) | |
download | gitblit-30abff544589292fbead49d2b04a96d604938eb0.tar.gz gitblit-30abff544589292fbead49d2b04a96d604938eb0.zip |
bugtraq: Catch exceptions from bugtraq and show message
Catch all exceptions, and not just IOExceptions, from bugtraq formatter.
If an exception is caught, ignore the bugtraq handling of the commit
message and show the plain message. Way better then not showing anything
just because something broke in bugtraq.
-rw-r--r-- | src/main/java/com/gitblit/utils/BugtraqProcessor.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/utils/BugtraqProcessor.java b/src/main/java/com/gitblit/utils/BugtraqProcessor.java index 67f220f6..8ecf948a 100644 --- a/src/main/java/com/gitblit/utils/BugtraqProcessor.java +++ b/src/main/java/com/gitblit/utils/BugtraqProcessor.java @@ -155,10 +155,10 @@ public class BugtraqProcessor { formatter.formatLogMessage(text, new BugtraqOutputHandler(sb)); text = sb.toString(); } - } catch (IOException e) { - logger.error(MessageFormat.format("Bugtraq config for {0} is invalid!", repositoryName), e); } catch (ConfigInvalidException e) { - logger.error(MessageFormat.format("Bugtraq config for {0} is invalid!", repositoryName), e); + logger.warn("Bugtraq config for {} is invalid!", repositoryName, e); + } catch (Exception e) { + logger.warn("Failed to parse message through Bugtraq.", e); } return text; |