### Home Classes Methods

### In Files

- lib/maruku/errors_management.rb
- lib/maruku.rb

### Methods

- #create_frame
- #describe_error
- #error
- #maruku_error
- #maruku_recover
- #raise_error
- #tell_user

### Class/Module Index

Quicksearch

- MaRuKu
- MaRuKu::Errors
- MaRuKu::Exception
- MaRuKu::Helpers
- MaRuKu::In
- MaRuKu::In::Markdown
- MaRuKu::In::Markdown::BlockLevelParser
- MaRuKu::In::Markdown::BlockLevelParser::BlockContext
- MaRuKu::In::Markdown::BlockLevelParser::LineSource
- MaRuKu::In::Markdown::SpanExtension
- MaRuKu::In::Markdown::SpanLevelParser
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceManual
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceStrscan
- MaRuKu::In::Markdown::SpanLevelParser::HTMLHelper
- MaRuKu::In::Markdown::SpanLevelParser::SpanContext
- MaRuKu::MDDocument
- MaRuKu::MDElement
- MaRuKu::Out
- MaRuKu::Out::HTML
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::LatexEntity
- MaRuKu::Out::Markdown
- MaRuKu::Section
- MaRuKu::Strings
- MaRuKu::Tests
- Array
- Hash
- Maruku
- Module
- NilClass
- Object
- String
- Textile2Signature

No matching classes.

# MaRuKu::Errors

### Public Instance Methods

create_frame(s) click to toggle source

    # File lib/maruku/errors_management.rb, line 70
    def create_frame(s)
            n = 75
            "\n" +
            " "+"_"*n + "\n"+
            "| Maruku tells you:\n" +
            "+" + ("-"*n) +"\n"+
            add_tabs(s,1,'| ') + "\n" +
            "+" + ("-"*n) + "\n" +
            add_tabs(caller[0, 5].join("\n"),1,'!') + "\n" +
            "\\" + ("_"*n) + "\n"
    end

describe_error(s,src,con) click to toggle source

    # File lib/maruku/errors_management.rb, line 82
    def describe_error(s,src,con)
            t = s
            src && (t += "\n#{src.describe}\n")
            con && (t += "\n#{con.describe}\n")
            t
    end

error(s,src=nil,con=nil) click to toggle source
Alias for: maruku_error
maruku_error(s,src=nil,con=nil) click to toggle source

    # File lib/maruku/errors_management.rb, line 41
    def maruku_error(s,src=nil,con=nil)
            policy = get_setting(:on_error)

            case policy
            when :ignore
            when :raise
                    raise_error create_frame(describe_error(s,src,con))
            when :warning
                    tell_user create_frame(describe_error(s,src,con))
            else
                    raise "BugBug: policy = #{policy.inspect}"
            end
    end

Also aliased as: error
maruku_recover(s,src=nil,con=nil) click to toggle source

    # File lib/maruku/errors_management.rb, line 55
    def maruku_recover(s,src=nil,con=nil)
            tell_user create_frame(describe_error(s,src,con))
    end

raise_error(s) click to toggle source

    # File lib/maruku/errors_management.rb, line 61
    def raise_error(s)
            raise MaRuKu::Exception, s, caller
    end

tell_user(s) click to toggle source

    # File lib/maruku/errors_management.rb, line 65
    def tell_user(s)
            error_stream = self.attributes[:error_stream] || $stderr
            error_stream << s
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.