Sha256: c8fb78dcc2f7e442de6c56a8c4354aea3b5d864d6811eb8e1ee53cc8b3d21381

Contents?: true

Size: 854 Bytes

Versions: 12

Compression:

Stored size: 854 Bytes

Contents

module Percheron
  class OhDear

    def initialize(exception)
      @exception = exception
    end

    def generate
      template
    end

    private

      attr_reader :exception

      # rubocop:disable Metrics/MethodLength
      def template
        <<-EOS

We are terribly sorry.. something unexpected occurred :(

--snip--

Info
----
Ruby: #{RUBY_VERSION}
Percheron: #{Percheron::VERSION}

Trace
-----
#{exception_message}

#{exception_backtrace}

--snip--

Please copy the detail between the --snip--'s above and raise a ticket please :)

https://github.com/ashmckenzie/percheron/issues/new?labels=bug

EOS
      end
      # rubocop:enable Metrics/MethodLength

      def exception_message
        exception.inspect
      end

      def exception_backtrace
        exception.backtrace ? exception.backtrace.join("\n") : ''
      end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
percheron-0.8.1 lib/percheron/oh_dear.rb
percheron-0.8.0 lib/percheron/oh_dear.rb
percheron-0.7.16 lib/percheron/oh_dear.rb
percheron-0.7.15 lib/percheron/oh_dear.rb
percheron-0.7.14 lib/percheron/oh_dear.rb
percheron-0.7.13 lib/percheron/oh_dear.rb
percheron-0.7.12 lib/percheron/oh_dear.rb
percheron-0.7.11 lib/percheron/oh_dear.rb
percheron-0.7.10 lib/percheron/oh_dear.rb
percheron-0.7.9 lib/percheron/oh_dear.rb
percheron-0.7.8 lib/percheron/oh_dear.rb
percheron-0.7.7 lib/percheron/oh_dear.rb