use different error classes in examples

Since rescuing from Exception class should be avoided, use other error classes in the code examples to avoid confusion.