Challenge 2: A Custom Exception — Solution class InvalidAgeError < StandardError def initialize(msg = "Age must be between 0 and 130") super end end def set_age(age) raise InvalidAgeError if age < 0 || age > 130 age end begin set_age(-5) rescue InvalidAgeError => e puts e.message end begin puts set_age(33) rescue InvalidAgeError => e puts e.message end =begin Output: Age must be between 0 and 130 33 Notes: - InvalidAgeError < StandardError makes this a proper custom exception class, following the chapter's rule to inherit from StandardError, not the bare Exception class. - initialize(msg = "...") followed by super passes the default message up to StandardError's own initialize, so e.message returns it automatically when no custom message is given at the raise site. - The first begin/rescue block catches the invalid age (-5) and prints the custom message. The second begin/rescue block passes a valid age (33) through set_age with no exception raised at all, so rescue never triggers there and 33 is simply returned and printed. =end