Sha256: c52a8b26ada290d8dda4214245c2be3defa46fa8e57ab5982aea337699fb9b93

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

#
# This file is part of the ballast gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
# Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
#

module Ballast
  # Common errors raised by a Rails application.
  module Errors
    # The base error raised from an application.
    #
    # @attribute [r] details
    #   @return [String|Hash|NilClass] The details of the error. If a Hash, it should contain the keys `status` and `error`.
    class Base < RuntimeError
      attr_reader :details

      # Creates a new error.
      #
      # @param details [String|Hash|NilClass] The details of this error.
      def initialize(details = nil)
        super("")
        @details = details
      end
    end

    # This is raised when an invalid domain is requested.
    class InvalidDomain < Base
    end

    # This is raised when something went wrong during the processing of a operation or a service.
    class Failure < Base
    end

    # This is raised when some invalid parameters are passed to a operation or a service.
    class ValidationFailure < Failure
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ballast-2.0.1 lib/ballast/errors.rb
ballast-2.0.0 lib/ballast/errors.rb