James Moger
2012-10-05 88aad76a0e54b4a8757bbc9ea45fec8f70baa832
Catch all exceptions from MarkdownPapers and rethrow as ParseException (issue-142)
2 files modified
7 ■■■■■ changed files
docs/04_releases.mkd 1 ●●●● patch | view | raw | blame | history
src/com/gitblit/utils/MarkdownUtils.java 6 ●●●●● patch | view | raw | blame | history
docs/04_releases.mkd
@@ -11,6 +11,7 @@
#### fixes
- Wrapped Markdown parser with improved exception handler (issue 142)
- Fixed duplicate entries in repository cache (issue 140)
- Fixed connection leak in LDAPUserService (issue 139)
- Fixed bug in commit page where changes to a submodule threw a null pointer exception (issue 132)
src/com/gitblit/utils/MarkdownUtils.java
@@ -67,9 +67,15 @@
            Markdown md = new Markdown();
            md.transform(markdownReader, writer);
            return writer.toString().trim();
        } catch (StringIndexOutOfBoundsException e) {
            LoggerFactory.getLogger(MarkdownUtils.class).error("MarkdownPapers failed to parse Markdown!", e);
            throw new java.text.ParseException(e.getMessage(), 0);
        } catch (ParseException p) {
            LoggerFactory.getLogger(MarkdownUtils.class).error("MarkdownPapers failed to parse Markdown!", p);
            throw new java.text.ParseException(p.getMessage(), 0);
        } catch (Exception e) {
            LoggerFactory.getLogger(MarkdownUtils.class).error("MarkdownPapers failed to parse Markdown!", e);
            throw new java.text.ParseException(e.getMessage(), 0);
        } finally {
            try {
                writer.close();