Forward exceptions from Article's virtual methods #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses (badly I presume) the problem that users need to stop on user-code error inside
Article's virtual method.It's essential otherwise they'll endup with garbaged ZIM files.
This first commit (8ed926d) achieves that but there is probably a be a better way to do it.
--
Another related commit regards the next step in this process, being able to stop the creation process when an error occurs.
The only workaround I found was to prevent calling
finalize()(node-libzim and zimwritefs exits before calling it for instance).As we call
close()and thusfinalize()on__exit__and__del__, for convenience, we have to bypass this.It works fine in scrapers but not on the tests as the reader's tests trigger a manual garbage collection which the libzim is not happy with, as
finalize()was never called…To overcome that yet still test this important capability, I'm instanciating a new VM in the test.
@mgautierfr, please consider it a POC to start the discussion on this. We can surely opt this test out for now . Exception stuff is mandatory though.