I didn't write this check, @arvoelke did. I just carried it along as I was trying to mimic the old behavior as much as possible.

try-catch blocks are more "Pythonic", and I think are preferred because they are more permissive; it's certainly possible to implement a `generate_key` method without being a `Network` instance. But, yeah, I'm not too bothered either way we do this.