module Tryouts::ClassMethods

def classify_error(exception)

Error classification for resilient error handling
def classify_error(exception)
  case exception
  when SystemExit, SignalException
    :non_recoverable_exit
  when Timeout::Error
    :transient
  when Errno::ENOENT, Errno::EACCES, Errno::EPERM
    :file_system
  when LoadError, NameError, NoMethodError
    :code_structure
  when SecurityError, NoMemoryError, SystemStackError
    :system_resource
  when SyntaxError, TryoutSyntaxError
    :syntax
  when StandardError
    :recoverable
  else
    :unknown
  end
end