Small refactoring "exceptions.py"