Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1954 Cause RuntimeError if plugin throw StopIteration #1955

Closed
wants to merge 2 commits into from

Conversation

pluser
Copy link

@pluser pluser commented Aug 20, 2015

Make Nikola raise RuntimeError If plugin throw StopIteration exception.
See the #1954 for detail.

@Kwpolska
Copy link
Member

Why bother? I would call this user error and not even following basic APIs because the function must return dicts

👎

@pluser
Copy link
Author

pluser commented Aug 20, 2015

Yes. That is user error. Of course, user should return dicts.
However, If user mistake and raise exception, It is better to show kind error message (like Traceback) instead of ambiguous message like: Scanning posts...Scanning posts...Scanning posts...Scanning posts...Scanning posts...Scanning posts...Scanning posts...ERROR: render_site. Task dependency 'generate_rss' does not exist..
Would you agree with this view?

@ralsina
Copy link
Member

ralsina commented Aug 20, 2015

It's early and I have had no coffee yet, but read_metadata can raise any other exception, and then the exact same thing will happen, right? This would only fix one specific problem.

@pluser
Copy link
Author

pluser commented Aug 20, 2015

No. read_metadata() can raise other exception like RuntimeError, KeyError, NameError, or something, but If those were raised, Nikola show Traceback correctly. Only StopIteration make false report as far as I know.

@Kwpolska
Copy link
Member

@ralsina, opinions?

@ralsina
Copy link
Member

ralsina commented Aug 22, 2015

@Kwpolska I'll have to take a real look at the code that calls that. I suspect it's not a problem with every plugin but with task plugins because we are unrolling iterators, so StopIteration makes everyone go nuts.

@Kwpolska Kwpolska closed this Sep 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants