Exception: Served::Resource::ResponseInvalid

Inherits:
Error show all
Defined in:
lib/served/resource/response_invalid.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource, original_error = false) ⇒ ResponseInvalid

Returns a new instance of ResponseInvalid.



4
5
6
7
8
9
10
11
12
13
# File 'lib/served/resource/response_invalid.rb', line 4

def initialize(resource, original_error = false)
  if original_error
    super "The resource '#{resource.name}' failed to serialize the " \
      "response with message: #{original_error.message}'"
    return
  end

  super "The resource '#{resource.name}' returned a response, but the result " \
        "of serialization was `nil`"
end