Fix example by making the exception inherit from Exception.