Method: OpenC3.handle_critical_exception

Defined in:
lib/openc3/top_level.rb

.handle_critical_exception(error, _try_gui = true) ⇒ Object

CriticalErrors are errors that need to be brought to a user’s attention but do not cause an exit. A good example is if the packet log writer fails and can no longer write the log file. Write a message to the Logger, write an exception file, and popup a GUI window if try_gui. Ensure the GUI only comes up once so this method can be called over and over by failing code.

Parameters:

  • error (Exception)

    The exception to handle

  • try_gui (Boolean)

    Whether to try and create a GUI exception popup



401
402
403
404
# File 'lib/openc3/top_level.rb', line 401

def self.handle_critical_exception(error, _try_gui = true)
  Logger.error "Critical Exception! #{error.formatted}"
  self.write_exception_file(error)
end