Deutsch English Français Italiano |
<lk72fhFo32jU1@mid.individual.net> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Greg Ewing <greg.ewing@canterbury.ac.nz> Newsgroups: comp.lang.python Subject: Re: psycopg2: proper positioning of .commit() within try: except: blocks Date: Mon, 9 Sep 2024 13:48:32 +1200 Lines: 11 Message-ID: <lk72fhFo32jU1@mid.individual.net> References: <Ztx1sZMGTnA3eLP1@hermes.hilbert.loc> <7cb50df2-9c76-477f-91c9-e149c7637104@aklaver.com> <ZtytJMhyvtExPxfF@hermes.hilbert.loc> <5ee80b84-f04b-454d-ab39-45572e0751a1@aklaver.com> <Zty7ZCMwKQl4C4Id@hermes.hilbert.loc> <4a1b12fc-24b7-4c7e-b1f2-6ec9c5f341c2@aklaver.com> <ZtzDubguRDWXwV-t@hermes.hilbert.loc> <62133ebd-a4a3-471b-9acc-3a988b4fcbd7@btinternet.com> <Zt2xHedGIh1-dL4g@hermes.hilbert.loc> <mailman.50.1725804833.2917.python-list@python.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net awOybTY9hYtMiE1VV+7faQyv7odWjHKl+3UHoQO8KkMFOXufmE Cancel-Lock: sha1:ocr2XKjZYb98DQO4i7tGZYmuHqY= sha256:xZCV6/uk/tUcbWnf9B89Dz3xw6X9T+H/XYSyUR0Lxa0= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Content-Language: en-US In-Reply-To: <mailman.50.1725804833.2917.python-list@python.org> Bytes: 1693 On 9/09/24 2:13 am, Karsten Hilbert wrote: > For what it's worth here's the current state of code: That code doesn't inspire much confidence in me. It's far too convoluted with too much micro-management of exceptions. I would much prefer to have just *one* place where exceptions are caught and logged. -- Greg