Use specific exception instead of class Exception.