Sha256: b01a5fe549f9eb720385289e792243ccb587d1cc2a7ac83101e80cb40b9f3cf0

Contents?: true

Size: 610 Bytes

Versions: 2

Compression:

Stored size: 610 Bytes

Contents

module WebToPay
  class Exception < ::StandardError
    # Missing field.
    E_MISSING = 1

    # Invalid field value.
    E_INVALID = 2

    # Max length exceeded.
    E_MAXLEN = 3

    # Regexp for field value doesn't match.
    E_REGEXP = 4

    # Missing or invalid user given parameters.
    E_USER_PARAMS = 5

    # Logging errors
    E_LOG = 6

    # SMS answer errors
    E_SMS_ANSWER = 7

    attr_accessor :code, :field_name

    def as_json(options = {})
      {
        error: {
          message: message,
          field_name: field_name,
          code: code
        }
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
webtopay-1.6.1 lib/webtopay/exception.rb
webtopay-1.6.0 lib/webtopay/exception.rb