#33331: Improve exception handling with `cursor.close()` after errors
-------------------------------------+-------------------------------------
     Reporter:  Daniel Hahler        |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

 Hi Daniel. Thanks for the reply.

 It's OK to not read the thread :)

 > ...not about context or cause, but only using raise from properly
 (according to...

 It's the force of ''properly'' here that's in doubt.

 On investigation, the difference between the two syntaxes amounted to no
 more (not much more) that the text used between the tracebacks — which are
 chained either way, either ''implicitly'' or ''explicitly'', unless `from
 None` is used. That difference in text, ''"During handling of the above
 exception, another exception occurred"'' vs ''"The above exception was the
 direct cause of the following exception"'', wasn't felt significant — not
 compared to the more verbose syntax, and in the PR you have here, much
 more verbose block in order to decide when to use it.

 Thus, with the exceptions noted above, it was decided not to use the
 `from` syntax. (We didn't agree with the blog post that not using it was
 ''improper''.)

 So, if there's a concrete example, of ''"Look, you get this benefit"'',
 then I'm really happy to look at that, and learn a trick, but pending
 that, we have to go with the previous consensus. I hope that makes sense.
 Thanks!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33331#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.ce34f5782945858172c14d0383b7c69a%40djangoproject.com.

Reply via email to