Sha256: 5f56475f0bc99ff73f50af00f4f7ee8ad020c63d861d9da395fe6f3a385ebe69

Contents?: true

Size: 748 Bytes

Versions: 10

Compression:

Stored size: 748 Bytes

Contents

require "i18n"

module Shamu

  module JsonApi
    # A generic error class for problems with shamu JSON API.
    class Error < Shamu::Error
      private

        def translation_scope
          super.dup.insert( 1, :json_api )
        end
    end

    # Raised if an {ResourceBuilder#identifier} was not built.
    class IncompleteResourceError < Error
      def initialize( message = :incomplete_resource )
        super
      end
    end

    class NoPresenter < Error
      def initialize( resource, namespaces )
        super translate( :no_presenter, class: resource.class, namespaces: namespaces )
      end
    end

    class NoJsonBodyError < Error
      def initialize( message = :no_json_body )
        super
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shamu-0.0.24 lib/shamu/json_api/error.rb
shamu-0.0.21 lib/shamu/json_api/error.rb
shamu-0.0.20 lib/shamu/json_api/error.rb
shamu-0.0.19 lib/shamu/json_api/error.rb
shamu-0.0.18 lib/shamu/json_api/error.rb
shamu-0.0.17 lib/shamu/json_api/error.rb
shamu-0.0.15 lib/shamu/json_api/error.rb
shamu-0.0.14 lib/shamu/json_api/error.rb
shamu-0.0.13 lib/shamu/json_api/error.rb
shamu-0.0.11 lib/shamu/json_api/error.rb