mirror of
https://github.com/ublue-os/forge.git
synced 2025-04-20 13:33:44 +03:00
fix(nicegui): better error handling
This commit is contained in:
parent
b05cd7686b
commit
f5c95c8d1e
|
@ -6,8 +6,13 @@ from utils.registry import DockerRegistry
|
||||||
|
|
||||||
## TODO: this should be async but I currently don't know how to implement this without button press
|
## TODO: this should be async but I currently don't know how to implement this without button press
|
||||||
def get_image_info() -> pandas.DataFrame:
|
def get_image_info() -> pandas.DataFrame:
|
||||||
registry = DockerRegistry()
|
data = pandas.DataFrame(columns=["image_name", "tag", "size"])
|
||||||
all_image_info = registry.get_all_image_info()
|
try:
|
||||||
|
registry = DockerRegistry()
|
||||||
|
all_image_info = registry.get_all_image_info()
|
||||||
|
except Exception as error:
|
||||||
|
ui.notify(message=error)
|
||||||
|
return data
|
||||||
if isinstance(all_image_info, list) and len(all_image_info) > 0:
|
if isinstance(all_image_info, list) and len(all_image_info) > 0:
|
||||||
data = pandas.json_normalize(
|
data = pandas.json_normalize(
|
||||||
all_image_info,
|
all_image_info,
|
||||||
|
@ -26,7 +31,6 @@ def get_image_info() -> pandas.DataFrame:
|
||||||
return data
|
return data
|
||||||
else:
|
else:
|
||||||
ui.notify(message="No images found")
|
ui.notify(message="No images found")
|
||||||
data = pandas.DataFrame(columns=["image_name", "tag", "size"])
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue