# frozen_string_literal: true

require_relative "synor_bridge/version"
require_relative "synor_bridge/types"
require_relative "synor_bridge/client"

module SynorBridge
  class Error < StandardError; end
  class ClientClosedError < Error; end
  class HttpError < Error
    attr_reader :status_code, :code

    def initialize(message, status_code: 0, code: nil)
      super(message)
      @status_code = status_code
      @code = code
    end

    def confirmations_pending?
      @code == "CONFIRMATIONS_PENDING"
    end
  end
end
