Python Forum
Changing a traceback message without a 2nd raise
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing a traceback message without a 2nd raise
#2
Try
try:
    1/0
except ZeroDivisionError as err:
    err.args = ("Don't do that",)
    raise
Reply


Messages In This Thread
RE: Changing a traceback message without a 2nd raise - by Gribouillis - Jul-14-2019, 12:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  raise exception within generator bermudj 3 2,981 Jun-06-2020, 11:56 AM
Last Post: buran
  can i raise an exception in a try clause? Skaperen 14 5,756 Dec-19-2019, 12:29 AM
Last Post: Skaperen
  raise exception instead of return None Skaperen 4 4,124 Jul-19-2018, 01:27 AM
Last Post: ichabod801
  "Raise SMTPException("SMTP AUTH extension not supported by server.") NajeebUllah 3 8,001 Mar-16-2018, 09:45 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020