Fix example by making the exception inherit from Exception.
Merge example fix with 3.2.
Merge example fix with 3.3.