Sha256: 6441b84dd42dd26c574ac7eddadb8293df35e55b1c7599300eb578a70136fe13
Contents?: true
Size: 869 Bytes
Versions: 13
Compression:
Stored size: 869 Bytes
Contents
module Appsignal class AuthCheck ACTION = 'auth'.freeze attr_reader :config, :logger def initialize(config, logger=Appsignal.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 => e result = 'Something went wrong while trying to '\ "authenticate with AppSignal: #{e}" [nil, result] end end end end
Version data entries
13 entries across 13 versions & 1 rubygems