Sha256: 5ff251f1bfbac3fdce85e8221e0b13b3dbd537ca6ab0534ecb2b03debff2d789
Contents?: true
Size: 862 Bytes
Versions: 189
Compression:
Stored size: 862 Bytes
Contents
module Appsignal class AuthCheck ACTION = 'auth'.freeze attr_reader :config, :logger def initialize(config, logger) @config = config @logger = logger end def perform Appsignal::Transmitter.new(ACTION, config).transmit({}) end def perform_with_result begin status = perform case status when '200' result = 'AppSignal has confirmed authorization!' when '401' result = 'API key not valid with AppSignal...' else result = 'Could not confirm authorization: '\ "#{status.nil? ? 'nil' : status}" end [status, result] rescue Exception => e result = 'Something went wrong while trying to '\ "authenticate with AppSignal: #{e}" [nil, result] end end end end
Version data entries
189 entries across 189 versions & 1 rubygems