Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75916

Re: Newbie needing some help

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.056
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'subject:help': 0.08; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'exception': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'absolute': 0.30; 'statement': 0.30; 'message- id:@mail.gmail.com': 0.30; 'subject:some': 0.31; "i'd": 0.34; 'problem': 0.35; 'transaction': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'error.': 0.37; 'rather': 0.38; 'even': 0.60; 'is.': 0.60; 'back': 0.62; 'bare': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=IzvNfeAcmaL1alJSKW9IFMxWN0wxfwLm5IR8Dw0rt4c=; b=YH0ks0qZAseG8Chk9V8mJgjxpXhnRO3aTkSzCer7gVEpyMG57B649x7Wu5SSEF+Jxn EXnxjM7cDGkZtrpndlHVIH9zwDRy6d0vRcMtYaHiidS8tMnHeBQY7/RqzPYAgioJ8KBV EzYmYWpHLYqR2fw0Pq2SQUkRtG7KFRo5CrsrfjCFgD7Rqjg756kV7A8IfUs8oFkkHhWE BxcjpGmFAIi4I+kx0XaqqxZoPCv8MzQL13pA++8bp5UkMmKDShQPaAQXfqTLLrTkq0eY lUu7+S3XjdHHBNr7VD8oNYrrNbMRYanWx45DdTBg4psbOhrryOm8f7VcX38JLN3qMTKj YU2Q==
MIME-Version 1.0
X-Received by 10.42.216.148 with SMTP id hi20mr15610283icb.12.1407541099424; Fri, 08 Aug 2014 16:38:19 -0700 (PDT)
In-Reply-To <CALvWhxtWyQw08TBVOTDhfFjm0=PP19QY3Yv-v74Q2T=ndyW91g@mail.gmail.com>
References <CANhUTb9tEnT=uTMhdA+Fd2zJTMauo1BWkX2dgcE0dG_H5arx9Q@mail.gmail.com> <CALvWhxtWyQw08TBVOTDhfFjm0=PP19QY3Yv-v74Q2T=ndyW91g@mail.gmail.com>
Date Sat, 9 Aug 2014 09:38:19 +1000
Subject Re: Newbie needing some help
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12772.1407541107.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1407541107 news.xs4all.nl 2955 [2001:888:2000:d::a6]:49813
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75916

Show key headers only | View raw


On Sat, Aug 9, 2014 at 8:01 AM, Chris Kaynor <ckaynor@zindagigames.com> wrote:
> However, I'd recommend re-raising the exception after rolling back the
> transaction with a bare "raise" statement right after the db.rollback() - at
> the absolute minimum, you should log the error. This will likely let you see
> what your problem is.

AIUI, aborting the process with an uncaught exception would roll back
implicitly, so there's no need to "bare except, roll back, bare
raise". But even if that's not the case, I would be looking at a
try/finally for this, rather than a try/except/raise.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Newbie needing some help Chris Angelico <rosuav@gmail.com> - 2014-08-09 09:38 +1000

csiph-web