Sha256: 4d9248281ca031f87e62893f0aaed8d53cafc26500de61586a1b744eabb233af

Contents?: true

Size: 1.67 KB

Versions: 18

Compression:

Stored size: 1.67 KB

Contents

# frozen_string_literal: true

module Salestation
  class App
    module Errors
      class Error < Dry::Struct
        attribute? :base_error, Types::Coercible::Hash

        def self.from(base_error, overrides = {})
          new(**overrides, base_error: base_error.to_h)
        end
      end

      class InvalidInput < Error
        attribute? :errors, Types::Strict::Hash
        attribute? :hints, Types::Coercible::Hash.default({}.freeze)
        attribute? :debug_message, Types::Strict::String
        attribute? :form_errors, Types::Strict::Bool.default(false)
      end

      class DependencyCurrentlyUnavailable < Error
        attribute? :message, Types::Strict::String
        attribute? :debug_message, Types::Strict::String
      end

      class RequestedResourceNotFound < Error
        attribute? :message, Types::Strict::String
        attribute? :debug_message, Types::Strict::String
      end

      class Forbidden < Error
        attribute? :message, Types::Strict::String
        attribute? :debug_message, Types::Strict::String
      end

      class Conflict < Error
        attribute? :message, Types::Strict::String
        attribute? :debug_message, Types::Strict::String
      end

      class NotAcceptable < Error
        attribute? :message, Types::Strict::String
        attribute? :debug_message, Types::Strict::String
      end

      class UnsupportedMediaType < Error
        attribute? :message, Types::Strict::String
        attribute? :debug_message, Types::Strict::String
      end

      class RequestEntityTooLarge < Error
        attribute? :message, Types::Strict::String
        attribute? :debug_message, Types::Strict::String
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
salestation-5.3.2 lib/salestation/app/errors.rb
salestation-5.3.1 lib/salestation/app/errors.rb
salestation-5.3.0 lib/salestation/app/errors.rb
salestation-5.2.0 lib/salestation/app/errors.rb
salestation-5.1.0 lib/salestation/app/errors.rb
salestation-5.0.2 lib/salestation/app/errors.rb
salestation-5.0.1 lib/salestation/app/errors.rb
salestation-5.0.0 lib/salestation/app/errors.rb
salestation-4.6.1 lib/salestation/app/errors.rb
salestation-4.6.0 lib/salestation/app/errors.rb
salestation-4.5.0 lib/salestation/app/errors.rb
salestation-4.4.2 lib/salestation/app/errors.rb
salestation-4.4.1 lib/salestation/app/errors.rb
salestation-4.4.0 lib/salestation/app/errors.rb
salestation-4.3.1 lib/salestation/app/errors.rb
salestation-4.3.0 lib/salestation/app/errors.rb
salestation-4.2.0 lib/salestation/app/errors.rb
salestation-4.1.0 lib/salestation/app/errors.rb