find_deprecated: better handling of exceptions
This commit is contained in:
parent
1cf5e4f88b
commit
c947fed756
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import traceback
|
||||
import argparse
|
||||
import tomlkit
|
||||
import multiprocessing
|
||||
@ -57,6 +58,7 @@ def upstream_last_update_ago(app: str) -> tuple[str, int | None]:
|
||||
raise RuntimeError(f"App {app} doesn't have an upstream code link!")
|
||||
|
||||
api = None
|
||||
try:
|
||||
if upstream.startswith("https://github.com/"):
|
||||
api = GithubAPI(upstream, auth=get_github()[0])
|
||||
|
||||
@ -83,6 +85,9 @@ def upstream_last_update_ago(app: str) -> tuple[str, int | None]:
|
||||
date = datetime.datetime.fromisoformat(date)
|
||||
ago: datetime.timedelta = datetime.datetime.now() - date.replace(tzinfo=None)
|
||||
return app, ago.days
|
||||
except Exception:
|
||||
logging.error(f"Exception while handling {app}", traceback.format_exc())
|
||||
raise
|
||||
|
||||
raise RuntimeError(f"App {app} not handled (not github, gitlab or gitea with autoupdate). Upstream is {upstream}")
|
||||
|
||||
@ -108,7 +113,7 @@ def main() -> None:
|
||||
try:
|
||||
app, result = next(tasks)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print(f"Exception found: {e}")
|
||||
continue
|
||||
|
||||
if result is None:
|
||||
|
Loading…
Reference in New Issue
Block a user