command: Set the 'feed' argument when raising NoToEmailAddress
Before this commit, if no default target email was setup in the
config:
$ r2e add example http://example.net/
Traceback (most recent call last):
File "/usr/bin/r2e", line 5, in <module>
rss2email.main.run()
File "/usr/lib/python3/dist-packages/rss2email/main.py", line 163, in run
args.func(feeds=feeds, args=args)
File "/usr/lib/python3/dist-packages/rss2email/command.py", line 50, in add
raise _error.NoToEmailAddress(feeds=feeds)
TypeError: __init__() missing 1 required positional argument: 'feed'
After this commit:
$ r2e add example http://example.net/
no target email address has been defined
I added the kwargs handling to FeedError so it will be passed through
to FeedsError because NoToEmailAddress has a diamond-inheritence that
includes both RSS2EmailError subclasses.
Reported-by: Jakub Wilk <jwilk@debian.org>
Signed-off-by: W. Trevor King <wking@tremily.us>