Sha256: 116d2c3ebdaf0a95a8f9a7e17a547877b4c33ddb423256aeb2688cd07e52cf4f

Contents?: true

Size: 303 Bytes

Versions: 1

Compression:

Stored size: 303 Bytes

Contents

# encoding: utf-8

module Outreach
  module Errors
    class Unauthorized < StandardError; end

    def check_for_error(status_code)
      # raise error if status code isn't 200
      case status_code.to_i
      when 401
        raise Unauthorized.new("Authorization failed")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
outreach-0.0.1 lib/outreach/errors.rb