Correctly type-hinting exception