Sha256: a7c6f54b16607cc5a73f363f83023e079fcd2f564eb57921dbcb8d2beaa04fb3

Contents?: true

Size: 678 Bytes

Versions: 43

Compression:

Stored size: 678 Bytes

Contents

# Top-level class for all REST Framework errors.
class RESTFramework::Error < StandardError
end

class RESTFramework::NilPassedToAPIResponseError < RESTFramework::Error
  def message
    return <<~MSG.split("\n").join(" ")
      Payload of `nil` was passed to `api_response`; this is unsupported. If you want a blank
      response, pass `''` (an empty string) as the payload. If this was the result of a `find_by`
      (or similar Active Record method) not finding a record, you should use the bang version (e.g.,
      `find_by!`) to raise `ActiveRecord::RecordNotFound`, which the REST controller will catch and
      return an appropriate error response.
    MSG
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
rest_framework-0.8.7 lib/rest_framework/errors.rb
rest_framework-0.8.6 lib/rest_framework/errors.rb
rest_framework-0.8.5 lib/rest_framework/errors.rb
rest_framework-0.8.4 lib/rest_framework/errors.rb
rest_framework-0.8.3 lib/rest_framework/errors.rb
rest_framework-0.8.2 lib/rest_framework/errors.rb
rest_framework-0.8.1 lib/rest_framework/errors.rb
rest_framework-0.8.0 lib/rest_framework/errors.rb
rest_framework-0.7.12 lib/rest_framework/errors.rb
rest_framework-0.7.11 lib/rest_framework/errors.rb
rest_framework-0.7.10 lib/rest_framework/errors.rb
rest_framework-0.7.9 lib/rest_framework/errors.rb
rest_framework-0.7.8 lib/rest_framework/errors.rb
rest_framework-0.7.7 lib/rest_framework/errors.rb
rest_framework-0.7.6 lib/rest_framework/errors.rb
rest_framework-0.7.5 lib/rest_framework/errors.rb
rest_framework-0.7.4 lib/rest_framework/errors.rb
rest_framework-0.7.3 lib/rest_framework/errors.rb
rest_framework-0.7.2 lib/rest_framework/errors.rb
rest_framework-0.7.1 lib/rest_framework/errors.rb