lib/cryptum/ui/portfolio.rb in cryptum-0.0.386 vs lib/cryptum/ui/portfolio.rb in cryptum-0.0.387

- old
+ new

@@ -36,11 +36,14 @@ crypto_currency = option_choice.symbol.to_s.upcase.split('_').first.to_sym portfolio = event_history.order_book[:portfolio] this_account = portfolio.select do |account| account[:currency] == crypto_currency.to_s end - raise "ID for Crypto Currency, #{crypto_currency} Not Found" if this_account.empty? + if this_account.empty? + e = "ID for Crypto Currency, #{crypto_currency} Not Found" + Cryptum::Log.append(level: :error, msg: e, which_self: self, event_history: event_history) + end balance = format("%0.#{crypto_smallest_decimal}f", this_account.first[:balance]) balance_out = Cryptum.beautify_large_number( value: balance ) @@ -195,14 +198,11 @@ ) portfolio_win.refresh event_history - rescue Interrupt - # Exit Gracefully if CTRL+C is Pressed During Session - Cryptum::UI::Exit.gracefully(event_history: event_history) - rescue StandardError => e - raise e + rescue Interrupt, StandardError => 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