docs: do not generate redirects on error
The build-finished event is also triggered when there's an error. I somehow got the second argument wrong, and ended up ignoring the case. This can lead to new exceptions being thrown due to missing files, that ends up hiding the real problem.
Fixes: 64a4ba9e ("docs: add an extension to generate redirects")