Sha256: 78a23013269dafa3710614b1d016c171c62988e3ff67b73c94d37343fb335d33

Contents?: true

Size: 736 Bytes

Versions: 20

Compression:

Stored size: 736 Bytes

Contents

module Knj::Errors
  class Notice < StandardError; end
  class NotFound < StandardError; end
  class InvalidData < StandardError; end
  class Retry < StandardError; end
  class NoAccess < StandardError; end
  class Exists < StandardError; end
  
  def self.error_str(err, args = {})
    if !err.is_a?(Exception) and err.class.message != "Java::JavaLang::LinkageError"
      raise "Invalid object of class '#{err.class.name}' given."
    end
    
    str = ""
    
    if args[:html]
      str << "<b>#{err.class.name}</b>: #{err.message}<br />\n<br />\n"
      str << err.backtrace.join("<br />\n")
    else
      str << "#{err.class.name}: #{err.message}\n\n"
      str << err.backtrace.join("\n")
    end
    
    return str
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
knjrbfw-0.0.29 lib/knj/errors.rb
knjrbfw-0.0.28 lib/knj/errors.rb
knjrbfw-0.0.27 lib/knj/errors.rb
knjrbfw-0.0.26 lib/knj/errors.rb
knjrbfw-0.0.25 lib/knj/errors.rb
knjrbfw-0.0.24 lib/knj/errors.rb
knjrbfw-0.0.23 lib/knj/errors.rb
knjrbfw-0.0.22 lib/knj/errors.rb
knjrbfw-0.0.21 lib/knj/errors.rb
knjrbfw-0.0.20 lib/knj/errors.rb
knjrbfw-0.0.19 lib/knj/errors.rb
knjrbfw-0.0.18 lib/knj/errors.rb
knjrbfw-0.0.17 lib/knj/errors.rb
knjrbfw-0.0.16 lib/knj/errors.rb
knjrbfw-0.0.15 lib/knj/errors.rb
knjrbfw-0.0.14 lib/knj/errors.rb
knjrbfw-0.0.13 lib/knj/errors.rb
knjrbfw-0.0.12 lib/knj/errors.rb
knjrbfw-0.0.11 lib/knj/errors.rb
knjrbfw-0.0.10 lib/knj/errors.rb