============================================================
 EXCEPTION HANDLING — ROBUST INPUT VALIDATOR - Demo Run
============================================================

--- try/except/else/finally in action ---

  Testing input: '42'
    Result: accepted, value=42

  Testing input: '-5'
    Result: rejected (-5 is negative, expected positive)

  Testing input: 'abc'
    Result: rejected (not a valid integer)

--- Custom exceptions: OutOfRangeError with data ---
  Caught: 150 is out of range [0, 100]  (value=150, range=[0,100])

--- Re-raising after partial handling (logging) ---
    [logged] Division by zero encountered with value=0
  Confirmed: exception was re-raised and caught here too (not swallowed).

--- Validation library demo ---
  '' (non-empty): REJECTED -- Input cannot be empty
  'valid text' (non-empty): OK
  'bad-email' (email): REJECTED -- 'bad-email' is not a valid email format
  'user@site.com' (email): OK

============================================================
 Assignment: shared ValidationError base catches all specific subclasses
============================================================
  [empty input] caught by single 'except ValidationError' handler: EmptyInputError: Input cannot be empty
  [out of range] caught by single 'except ValidationError' handler: OutOfRangeError: 999 is out of range [0, 10]
  [bad format] caught by single 'except ValidationError' handler: InvalidFormatError: 'not-an-email' is not a valid email format
