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