Capture any issue with juju connection

This commit is contained in:
2025-12-29 16:20:40 +00:00
parent b9e96d1341
commit aec04ad32b

View File

@@ -6,6 +6,7 @@ import logging
import sys
from juju.model import Model
from juju.errors import JujuConnectionError
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
@@ -65,7 +66,10 @@ async def main(args):
if the_model == "local":
await model.connect_current()
else:
await model.connect(the_model)
try:
await model.connect(the_model)
except JujuConnectionError as e:
logger.error(e)
try:
for key, action in actions: