How can I raise one error instead of the other?

so instead of ValueError, I am trying to raise AttributeError. my code so far, wich raises both a ValueError and an AttributeError:

except ValueError as error:
   raise AttributeError(f"AttributeError")

A post was merged into an existing topic: Can’t continue the code after raising an Attribute error