lib/cryptum/bot_conf.rb in cryptum-0.0.386 vs lib/cryptum/bot_conf.rb in cryptum-0.0.387
- old
+ new
@@ -39,20 +39,13 @@
f.puts "Module: #{self}"
f.puts "#{e}\n\n\n"
end
retry
- rescue Interrupt
- # Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum::UI::Exit.gracefully(
- which_self: self,
- event_history: event_history,
- option_choice: option_choice
- )
- rescue StandardError => e
+ rescue Interrupt, StandardError => e
# Produce a Stacktrace for anything else
- raise e
+ Cryptum::Log.append(level: :error, msg: e, which_self: self, event_history: event_history)
end
# SAUCE 1
# Calculate Target Profit Margin Percent Based Upon
# Observed Margins of Change in the Past 24hrs.
@@ -145,25 +138,19 @@
f.puts "Module: #{self}"
f.puts "#{e}\n\n\n"
end
retry
- rescue Interrupt
- # Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum::UI::Exit.gracefully(
- which_self: self,
- event_history: event_history,
- option_choice: option_choice
- )
- rescue StandardError => e
+ rescue Interrupt, StandardError => e
# Produce a Stacktrace for anything else
- raise e
+ Cryptum::Log.append(level: :error, msg: e, which_self: self, event_history: event_history)
end
# Update Key/Value Pair in Bot Conf and Serialize to YAML File
public_class_method def self.update(opts = {})
option_choice = opts[:option_choice]
+ event_history = opts[:event_history]
bot_conf = opts[:bot_conf]
key = opts[:key].to_s.to_sym
value = opts[:value]
session_root = option_choice.session_root
@@ -178,18 +165,12 @@
f.puts "Module: #{self}"
f.puts "#{e}\n\n\n"
end
retry
- rescue Interrupt
- # Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum::UI::Exit.gracefully(
- which_self: self,
- option_choice: option_choice
- )
- rescue StandardError => e
+ rescue Interrupt, StandardError => e
# Produce a Stacktrace for anything else
- raise e
+ Cryptum::Log.append(level: :error, msg: e, which_self: self, event_history: event_history)
end
# Display Usage for this Module
public_class_method def self.help