iiitv / lyrics-crawler

Simple crawler to collect lyrics, written in Python
Apache License 2.0
10 stars 4 forks source link

Use of too broad (broadest) exception clause #7

Closed singhpratyush closed 8 years ago

singhpratyush commented 8 years ago

We are using too broad exception clauses (except Exception as e:) at many places. This is not a good exercise. We must identify the possible exceptions that may occur and take steps accordingly.

Some examples are -

try:
        makedirs(location)
except Exception:
        print_warning('Download directory already exists')
try:
    raw_html = str(request.urlopen(req).read(), 'utf-8')
    done = True
except Exception:
    print_error('{0} : Error occurred while getting {1}, retrying'.format(thread_id, website))
singhpratyush commented 8 years ago

No longer an issue.