Catch conversion errors. #1253

Merged
merged 1 commit into from Jul 1, 2013

Projects

None yet

3 participants

@parkr
Member
parkr commented Jun 30, 2013

If the markdown converter raises an error for any reason (assuming the error thrown is StandardError or a subclass thereof), we'll print the path to the file which caused the error.

One of the items of #1105. Fixes #1238.

@parkr
Member
parkr commented Jun 30, 2013

Here's the output of a test run with a MaRuKu error:

~/code/jekyll/tsite$ ../bin/jekyll build
Configuration file: /Users/parker/code/jekyll/tsite/_config.yml
            Source: /Users/parker/code/jekyll/tsite
       Destination: /Users/parker/code/jekyll/tsite/_site
      Generating...
 ___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| No closing ): I will not create the link for ["aboutñ"]
| ---------------------------------------------------------------------------
| [aboutñ](EOF
| ----------|-----------------------------------------------------------------
|           +--- Byte 10
| Shown bytes [0 to 9] of 9:
| >[aboutñ](
|
| At line 2
|       text     |[aboutñ](|
|
|
| Elements read in span:
+---------------------------------------------------------------------------
!/Users/parker/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/errors_management.rb:56:in `maruku_recover'
!/Users/parker/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:588:in `read_link'
!/Users/parker/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:146:in `read_span'
!/Users/parker/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:46:in `parse_span_better'
!/Users/parker/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_span_better.rb:36:in `parse_lines_as_span'
\___________________________________________________________________________
  Conversion error: There was an error converting 'about/index.md'.
error: MaRuKu encountered problem(s) while converting your markup.. Use --trace to view backtrace
@benbalter
Contributor

zOMG. yes. 👍 🎉 🎷 🐢

@mattr-
Member
mattr- commented Jul 1, 2013

Awesome! 👍 ⭐️ 🌟 🎉 :shipit:

@mattr- mattr- merged commit 359383b into master Jul 1, 2013

1 check passed

default The Travis CI build passed
Details
@mattr- mattr- deleted the catch-conversion-errors branch Jul 1, 2013
@mattr- mattr- added a commit that referenced this pull request Jul 1, 2013
@mattr- mattr- Update history to reflect merge of #1253 826a70f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment