Skip to content

Commit

Permalink
updated error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnight95 committed Oct 3, 2023
1 parent e51c4b5 commit c5462fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions page_analyzer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ def check_url(id):
):
flash('Произошла ошибка при проверке', 'error')
return redirect(url_for('url_info', id=id))
else:
if page.status_code != 200:
flash('Произошла ошибка при проверке', 'danger')

soup = BeautifulSoup(page.text, 'html.parser')
crutch = soup.find('meta', attrs={'name': 'description'})
Expand Down

0 comments on commit c5462fd

Please sign in to comment.