Python Forum
Creating custom exceptions that co-operate
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating custom exceptions that co-operate
#2
What's LSP? I have a degree in computer science and five years' experience with software engineering and I'm unfamiliar with the acronym.

That said, I'm confused by your final code. You don't show the use of MissingStudentValue but I'm doubtful that you pass more than two arguments to it (after all, why would you?). What you probably meant to do was to pass your two named arguments into super so that when the stack trace is printed, it shows your message, e.g.
Output:
>>> raise Exception("what", "hey") Traceback (most recent call last): File "<stdin>", line 1, in <module> Exception: ('what', 'hey')
That said, what are you doing that actually needs super()?
Reply


Messages In This Thread
RE: Creating custom exceptions that co-operate - by micseydel - Mar-19-2019, 01:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom method to handle exceptions not working as expected gradlon93 3 2,066 Dec-22-2022, 07:12 PM
Last Post: deanhystad
  PiCamera - print exceptions? korenron 2 1,497 Dec-15-2022, 10:48 PM
Last Post: Larz60+
  Class exceptions DPaul 1 1,867 Mar-11-2022, 09:01 AM
Last Post: Gribouillis
  is this a good way to catch exceptions? korenron 14 7,029 Jul-05-2021, 06:20 PM
Last Post: hussaind
  Python, exceptions KingKhan248 6 4,193 Nov-15-2020, 06:54 AM
Last Post: buran
  Split string between two different delimiters, with exceptions DreamingInsanity 2 2,923 Aug-24-2020, 08:23 AM
Last Post: DreamingInsanity
  handling 2 exceptions at once Skaperen 2 3,172 Jun-27-2020, 08:55 AM
Last Post: Yoriz
  remove spaces with exceptions catosp 4 3,243 May-29-2020, 09:32 AM
Last Post: catosp
  Looking for advice and Guidance on Exceptions used within Functions paul41 1 2,669 Nov-14-2019, 12:33 AM
Last Post: Larz60+
  multi-line messages in raised exceptions? Skaperen 3 9,226 Aug-01-2019, 02:17 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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