Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #98116
| Path | csiph.com!goblin3!goblin.stu.neva.ru!panix!gordon |
|---|---|
| From | John Gordon <gordon@panix.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: How to handle exceptions properly in a pythonic way? |
| Date | Mon, 2 Nov 2015 20:05:36 +0000 (UTC) |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Lines | 21 |
| Message-ID | <n18fmg$oj6$1@reader1.panix.com> (permalink) |
| References | <4b303213-62e2-42d4-b2f6-4fc1f6025944@googlegroups.com> |
| NNTP-Posting-Host | panix1.panix.com |
| X-Trace | reader1.panix.com 1446494736 25190 166.84.1.1 (2 Nov 2015 20:05:36 GMT) |
| X-Complaints-To | abuse@panix.com |
| NNTP-Posting-Date | Mon, 2 Nov 2015 20:05:36 +0000 (UTC) |
| User-Agent | nn/6.7.3 |
| Xref | csiph.com comp.lang.python:98116 |
Show key headers only | View raw
In <4b303213-62e2-42d4-b2f6-4fc1f6025944@googlegroups.com> zljubisic@gmail.com writes:
> Let's say that I have the following simple function:
> def get_html(url):
> wpage = requests.get(url)
>
> return wpage.text
> How to handle exceptions properly that can arise during execution of the
> requests.get(url)?
The best way is probably to do nothing at all, and let the caller handle
any exceptions.
--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to handle exceptions properly in a pythonic way? zljubisic@gmail.com - 2015-11-02 11:24 -0800
Re: How to handle exceptions properly in a pythonic way? John Gordon <gordon@panix.com> - 2015-11-02 20:05 +0000
Re: How to handle exceptions properly in a pythonic way? zljubisic@gmail.com - 2015-11-04 19:41 -0800
Re: How to handle exceptions properly in a pythonic way? Chris Angelico <rosuav@gmail.com> - 2015-11-05 14:58 +1100
Re: How to handle exceptions properly in a pythonic way? zljubisic@gmail.com - 2015-11-04 20:18 -0800
Re: How to handle exceptions properly in a pythonic way? Chris Angelico <rosuav@gmail.com> - 2015-11-05 15:51 +1100
Re: How to handle exceptions properly in a pythonic way? zljubisic@gmail.com - 2015-11-09 13:43 -0800
Re: How to handle exceptions properly in a pythonic way? tian.su.yale@gmail.com - 2015-11-04 21:02 -0800
Re: How to handle exceptions properly in a pythonic way? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-02 13:58 -0700
Re: How to handle exceptions properly in a pythonic way? zljubisic@gmail.com - 2015-11-04 20:11 -0800
Re: How to handle exceptions properly in a pythonic way? tian.su.yale@gmail.com - 2015-11-04 21:15 -0800
Re: How to handle exceptions properly in a pythonic way? zljubisic@gmail.com - 2015-11-09 13:36 -0800
csiph-web