Sha256: 2ad27d308deff25caa7eb2ba23067ab8aa74d05201ee2791e2c67448e35ca581

Contents?: true

Size: 739 Bytes

Versions: 1

Compression:

Stored size: 739 Bytes

Contents

# frozen_string_literal: true

module Hcheck
  module Errors
    # Hcheck standard error class
    class HcheckError < StandardError
      MSG = 'Hcheck standard error'

      def initialize(msg = nil)
        message = msg || self.class::MSG
        Hcheck.logger.error message
        super(message)
      end
    end

    class InvalidAuthentication < HcheckError
      MSG = 'Invalid authenticity token!'
    end

    class IncompleteAuthSetup < HcheckError
      MSG = 'Incomplete auth setup in HCheck server'
    end

    class ConfigurationError < HcheckError
      MSG = 'Hcheck configuration cannot not be found or read'

      def initialize(err)
        super("#{MSG}\n#{err.class}\n#{err.message}")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hcheck-0.1.0 lib/hcheck/errors.rb