fossasia / open-event-server

Exceptions are overlapping PYL-W0714
Anti-pattern
Major
5 months agoa year old
Overlapping exceptions (OSError is an ancestor class of requests.exceptions.InvalidURL)
250        group.thumbnail_image_url = uploaded_images['thumbnail_image_url']
251        save_to_db(group)
252        logging.info(f'Resized images saved successfully for group with id: {group_id}')
253    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL, OSError):254        logging.exception(
255            'Error encountered while generating resized images for group with id: {}'.format(
256                group_id
Overlapping exceptions (OSError is an ancestor class of requests.exceptions.HTTPError)
250        group.thumbnail_image_url = uploaded_images['thumbnail_image_url']
251        save_to_db(group)
252        logging.info(f'Resized images saved successfully for group with id: {group_id}')
253    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL, OSError):254        logging.exception(
255            'Error encountered while generating resized images for group with id: {}'.format(
256                group_id
Overlapping exceptions (OSError is an ancestor class of requests.exceptions.HTTPError)
228        logging.info(
229            f'Resized images saved successfully for exhibitor with id: {exhibitor_id}'
230        )
231    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL, OSError):232        logging.exception(
233            'Error encountered while generating resized images for exhibitor with id: {}'.format(
234                exhibitor_id
Overlapping exceptions (OSError is an ancestor class of requests.exceptions.InvalidURL)
228        logging.info(
229            f'Resized images saved successfully for exhibitor with id: {exhibitor_id}'
230        )
231    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL, OSError):232        logging.exception(
233            'Error encountered while generating resized images for exhibitor with id: {}'.format(
234                exhibitor_id
Overlapping exceptions (urllib.error.URLError is an ancestor class of urllib.error.HTTPError)
108                uploaded_image = create_system_image(
109                    data['system_image_url'], unique_identifier=event_topic.id
110                )
111            except (urllib.error.HTTPError, urllib.error.URLError):112                raise UnprocessableEntityError(
113                    {'source': 'attributes/system-image-url'}, 'Invalid Image URL'
114                )