fix: do not fail when one of the extension manifest files is not available
This commit is contained in:
parent
4efeae24d0
commit
032a000da7
2 changed files with 24 additions and 26 deletions
|
|
@ -80,10 +80,7 @@ async def extensions_install(
|
||||||
] = await InstallableExtension.get_installable_extensions()
|
] = await InstallableExtension.get_installable_extensions()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.warning(ex)
|
logger.warning(ex)
|
||||||
raise HTTPException(
|
extension_list = []
|
||||||
status_code=HTTPStatus.NOT_FOUND,
|
|
||||||
detail="Cannot fetch installable extension list",
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if deactivate:
|
if deactivate:
|
||||||
|
|
|
||||||
|
|
@ -225,12 +225,11 @@ class InstallableExtension(NamedTuple):
|
||||||
|
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
for url in settings.lnbits_extensions_manifests:
|
for url in settings.lnbits_extensions_manifests:
|
||||||
|
try:
|
||||||
resp = await client.get(url)
|
resp = await client.get(url)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
raise HTTPException(
|
logger.warning(f"Unable to fetch extension list for repository: {url}")
|
||||||
status_code=404,
|
continue
|
||||||
detail=f"Unable to fetch extension list for repository: {url}",
|
|
||||||
)
|
|
||||||
for e in resp.json()["extensions"]:
|
for e in resp.json()["extensions"]:
|
||||||
extension_list += [
|
extension_list += [
|
||||||
InstallableExtension(
|
InstallableExtension(
|
||||||
|
|
@ -246,6 +245,8 @@ class InstallableExtension(NamedTuple):
|
||||||
else [],
|
else [],
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(e)
|
||||||
|
|
||||||
return extension_list
|
return extension_list
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue