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 thus finalize() 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.
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 callclose()
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.