lib/tracebin/reporter.rb in tracebin-0.0.9 vs lib/tracebin/reporter.rb in tracebin-0.0.10

- old
+ new

@@ -60,18 +60,22 @@ logger.debug "TRACEBIN: Server responded with a status code of #{res.code}." res rescue Exception => e logger.warn "TRACEBIN: Exception occurred sending data to the server: #{e.message}" + logger.debug "TRACEBIN: #{e.backtrace.join("\n\t")}" Tracebin::Agent.stop! end def handle_response(res, payload) case res when Net::HTTPSuccess logger.info 'TRACEBIN: Successfully sent payload to the server.' - when Net::HTTPBadRequest + when Net::HTTPNotFound logger.warn 'TRACEBIN: App bin ID not found. Please create a new app bin and add it to the config.' + Tracebin::Agent.stop! + when Net::HTTPBadRequest + logger.warn 'Something went wrong with the server. Please contact us!' Tracebin::Agent.stop! else logger.warn 'TRACEBIN: Failed to send data to the server. Will try again in 1 minute.' @storage.add_payload payload end