Sha256: 5b35b4aeb409daf722f3064e0917e31547b01e7ae28a7ccfd000b964704a3f22

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

# typed: true
# frozen_string_literal: true

module Workato
  module Connector
    module Sdk
      InvalidDefinitionError = Class.new(StandardError)

      InvalidSchemaError = Class.new(StandardError)

      CustomRequestError = Class.new(StandardError)

      RuntimeError = Class.new(StandardError)

      class RequestError < StandardError
        attr_reader :method
        attr_reader :code
        attr_reader :response

        def initialize(message:, method:, code:, response:)
          super(message)
          @method = method
          @code = code
          @response = response
        end
      end

      class NotImplementedError < StandardError
        def initialize(msg = 'This part of Connector SDK is not implemented in workato-connector-sdk yet')
          super
        end
      end

      class MissingRequiredInput < StandardError
        def initialize(label, toggle_label)
          message = if toggle_label && label != toggle_label
                      "Either '#{label}' or '#{toggle_label}' must be present"
                    else
                      "'#{label}' must be present"
                    end
          super(message)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workato-connector-sdk-1.0.3 lib/workato/connector/sdk/errors.rb
workato-connector-sdk-1.0.2 lib/workato/connector/sdk/errors.rb