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


Groups > comp.lang.python > #112350

Re: Python Error message

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Python Error message
Date 2016-08-05 05:53 +1000
Message-ID <mailman.178.1470340412.6033.python-list@python.org> (permalink)
References (1 earlier) <57a36593$0$1590$c3e8da3$5496439d@news.astraweb.com> <CA+FnnTw3b-iudGYJomeUYRQo_4ZathC7E1vWVqLDGqDo74JfDA@mail.gmail.com> <23e36680-195e-b840-599e-e225cdc2cee8@mrabarnett.plus.com> <no05g6$b25$1@blaine.gmane.org> <CAPTjJmr1KHJW3sWa+0cX=PG-o1=_PbtZmeL8mibjoqvOMaOn8Q@mail.gmail.com>

Show all headers | View raw


On Fri, Aug 5, 2016 at 5:36 AM, Terry Reedy <tjreedy@udel.edu> wrote:
> An example of the latter is when one writes code in Python to execute
> 'other' code.  (IDLE is one example.  It both executes user statements and
> evals user expressions.)  One needs "except BaseException:"  to isolate the
> interpreter from exceptions raised in the interpreted code. (It would be
> wrong for IDLE to stop because a user submitted code that raises, whether
> intentionally or accidentally)  A 'raise' that throws the exception into the
> interpreter is likely the worst thing to do.

This is a classic example of a "boundary location". Another extremely
common example is a web server: if an exception bubbles out of a
request handler function, the outer wrapper code should catch that,
log it, and send a 500 back to the client.

But none of this is what the OP is doing.

ChrisA

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


Thread

Python Error message GBANE FETIGUE <bemen77@gmail.com> - 2016-08-04 08:31 -0700
  Re: Python Error message Chris Angelico <rosuav@gmail.com> - 2016-08-05 01:51 +1000
  Re: Python Error message Steven D'Aprano <steve+python@pearwood.info> - 2016-08-05 01:56 +1000
    Re: Python Error message Igor Korot <ikorot01@gmail.com> - 2016-08-04 12:09 -0400
    Re: Python Error message Chris Angelico <rosuav@gmail.com> - 2016-08-05 02:14 +1000
    Re: Python Error message MRAB <python@mrabarnett.plus.com> - 2016-08-04 17:19 +0100
    Re: Python Error message Terry Reedy <tjreedy@udel.edu> - 2016-08-04 15:36 -0400
    Re: Python Error message Chris Angelico <rosuav@gmail.com> - 2016-08-05 05:53 +1000
  Re: Python Error message dieter <dieter@handshake.de> - 2016-08-05 09:03 +0200

csiph-web