1
0
mirror of https://git.sr.ht/~tsileo/microblog.pub synced 2025-06-05 21:59:23 +02:00

Improve webmentions

This commit is contained in:
Thomas Sileo
2022-12-31 16:53:05 +01:00
parent dfc7ab0470
commit 51c596dd1d
2 changed files with 30 additions and 10 deletions

View File

@ -21,6 +21,13 @@ def make_abs(url: str | None, parent: str) -> str | None:
)
def must_make_abs(url: str | None, parent: str) -> str:
abs_url = make_abs(url, parent)
if not abs_url:
raise ValueError("missing URL")
return abs_url
class InvalidURLError(Exception):
pass