Skip to content

Commit

Permalink
exception handling in page __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslaff committed Apr 11, 2023
1 parent e198a13 commit 295ffba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ if [ "$MODE" == "dev" ]
then
echo build development mode
sudo docker build -t yaroslaff/nudecrawler:dev -f docker/DevDockerfile .
else
echo build version $MODE
echo === $MODE
sudo docker build --build-arg VERSION=$MODE -t yaroslaff/nudecrawler:$MODE -f docker/Dockerfile .

echo === LATEST
sudo docker build --build-arg VERSION=$MODE -t yaroslaff/nudecrawler:latest -f docker/Dockerfile .
fi
3 changes: 2 additions & 1 deletion nudecrawler/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def __init__(self, url: str, all_found=False, detect_image=None, min_total_image
self._ignore = True
self.http_code = e.status
else:
self.http_code = e.status
if hasattr(e, 'status'):
self.http_code = e.status
self.ignore(f'Exception {e} with {self.url}')
return
self.content_length = page.headers.get('content-length')
Expand Down
2 changes: 1 addition & 1 deletion nudecrawler/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version="0.3.11"
version="0.3.12"

0 comments on commit 295ffba

Please sign in to comment.