Skip to content

Commit

Permalink
Save exception
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Sep 21, 2022
1 parent 509360b commit c378727
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions check_link/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Link:
code: Optional[int] = None
details: str = "Link is not checked yet"
delay: float = 0
exc: Optional[Exception] = None

def __post_init__(self):
url = urlparse(self.link)
Expand All @@ -77,6 +78,8 @@ def state_from_code(
self.reason = reason

def state_from_exception(self, err: Exception):
self.exc = err

if isinstance(err, TimeoutError):
self.state = State.timeout
else:
Expand Down

0 comments on commit c378727

Please sign in to comment.