Title: How not to handle an exception in Python - Considerate Code
Open Graph Title: How not to handle an exception in Python - Considerate Code
Open Graph Description: Have a look at this piece of code: Can you spot the anti-pattern? The first thing that hits the eye is the overly broad except clause. You want to be as specific as possible when catching exceptions, but at the very least, you should limit the except clause to the class Exception. The class hierarchy […]
Opengraph URL: https://consideratecode.com/2018/10/17/how-not-to-handle-an-exception-in-python/
Generator: WordPress 6.1.7
Domain: consideratecode.com
{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://consideratecode.com/#website","url":"https://consideratecode.com/","name":"Considerate Code","description":"","potentialAction":[{"@type":"SearchAction","target":"https://consideratecode.com/?s={search_term_string}","query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://consideratecode.com/2018/10/17/how-not-to-handle-an-exception-in-python/#primaryimage","inLanguage":"en-US","url":"https://consideratecode.com/wp-content/uploads/2018/10/how-not-to-handle-exceptions-in-python.png","width":2000,"height":1000},{"@type":"WebPage","@id":"https://consideratecode.com/2018/10/17/how-not-to-handle-an-exception-in-python/#webpage","url":"https://consideratecode.com/2018/10/17/how-not-to-handle-an-exception-in-python/","name":"How not to handle an exception in Python - Considerate Code","isPartOf":{"@id":"https://consideratecode.com/#website"},"primaryImageOfPage":{"@id":"https://consideratecode.com/2018/10/17/how-not-to-handle-an-exception-in-python/#primaryimage"},"datePublished":"2018-10-17T20:00:31+00:00","dateModified":"2018-10-17T20:00:31+00:00","author":{"@id":"https://consideratecode.com/#/schema/person/7dadc151a8bcd841a21a5569c6cf0cad"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https://consideratecode.com/2018/10/17/how-not-to-handle-an-exception-in-python/"]}]},{"@type":"Person","@id":"https://consideratecode.com/#/schema/person/7dadc151a8bcd841a21a5569c6cf0cad","name":"Daniel Hepper","image":{"@type":"ImageObject","@id":"https://consideratecode.com/#personlogo","inLanguage":"en-US","url":"https://secure.gravatar.com/avatar/8f00eb0653166f5eeaa7ba424a02e4b3?s=96&d=mm&r=g","caption":"Daniel Hepper"},"sameAs":["https://consideratecode.com"]}]}
| og:locale | en_US |
| og:type | article |
| og:site_name | Considerate Code |
| article:published_time | 2018-10-17T20:00:31+00:00 |
| og:image | https://consideratecode.com/wp-content/uploads/2018/10/how-not-to-handle-exceptions-in-python.png |
| og:image:width | 2000 |
| og:image:height | 1000 |
| twitter:card | summary_large_image |
| twitter:label1 | Written by |
| twitter:data1 | Daniel Hepper |
| twitter:label2 | Est. reading time |
| twitter:data2 | 3 minutes |
Links:
Viewport: width=device-width, initial-scale=1
Robots: index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1