mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-27 09:02:19 +00:00
add Source.on_exception event hook
This commit is contained in:
parent
de1634a587
commit
cf817ffe27
@ -170,7 +170,9 @@ class Source:
|
||||
for fu in asyncio.as_completed(futures):
|
||||
name, result = await fu
|
||||
if isinstance(result, Exception):
|
||||
logger.error('unexpected error happened', name=name, exc_info=result)
|
||||
logger.error('unexpected error happened',
|
||||
name=name, exc_info=result)
|
||||
self.on_exception(name, result)
|
||||
elif result is not None:
|
||||
self.print_version_update(name, result)
|
||||
|
||||
@ -191,6 +193,9 @@ class Source:
|
||||
def on_update(self, name, version, oldver):
|
||||
pass
|
||||
|
||||
def on_exception(self, name, exc):
|
||||
pass
|
||||
|
||||
def __repr__(self):
|
||||
return '<Source from %r>' % self.name
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user