When we fail in any case, there is no need to check the output file etc. Just ensure that the right exception is thrown. We might want to implement a new class for it, or find one which already comes with default python.