lib/render/errors.rb in render-0.0.2 vs lib/render/errors.rb in render-0.0.3

- old
+ new

@@ -1,7 +1,19 @@ module Render module Errors + class InvalidType < StandardError + attr_accessor :name + + def initialize(name) + self.name = name + end + + def to_s + "Cannot parse type: #{name}." + end + end + class Generator class MalformedAlgorithm < StandardError attr_accessor :algorithm def initialize(algorithm) @@ -21,27 +33,27 @@ def initialize(config_key) self.config_key = config_key end def to_s - "No value for key #{config_key} found in config or parental_attributes." + "No value for key #{config_key} found in config or parental_properties." end end end - class Schema - class NotFound < StandardError - attr_accessor :title + class DefinitionNotFound < StandardError + attr_accessor :title - def initialize(title) - self.title = title - end + def initialize(title) + self.title = title + end - def to_s - "Schema with title #{title} is not loaded" - end + def to_s + "Schema with title #{title} is not loaded" end + end + class Schema class RequestError < StandardError attr_accessor :endpoint, :response def initialize(endpoint, response) self.endpoint = endpoint