Skip to content

Commit 045b22a

Browse files
committed
Fix error when app key does not exists
1 parent 27ef9ac commit 045b22a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cli/config.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
options.WHAT_GROUPS: [__JSON_KEY_GROUPS, groups.export],
8888
}
8989

90+
9091
def __parse_args(desc):
9192
parser = options.set_common_args(desc)
9293
parser = options.set_key_arg(parser)
@@ -209,6 +210,8 @@ def __export_config_sync(endpoint: platform.Platform, what: list[str], **kwargs)
209210
sq_settings[ndx] = func(endpoint, export_settings=export_settings, key_list=key_list)
210211
except exceptions.UnsupportedOperation as e:
211212
log.warning(e.message)
213+
except exceptions.ObjectNotFound as e:
214+
log.error(e.message)
212215
sq_settings = utilities.remove_empties(sq_settings)
213216
if not kwargs["dontInlineLists"]:
214217
sq_settings = utilities.inline_lists(sq_settings, exceptions=("conditions",))
@@ -238,6 +241,8 @@ def __export_config_async(endpoint: platform.Platform, what: list[str], **kwargs
238241
__write_export(sq_settings, kwargs[options.REPORT_FILE], kwargs[options.FORMAT])
239242
except exceptions.UnsupportedOperation as e:
240243
log.warning(e.message)
244+
except exceptions.ObjectNotFound as e:
245+
log.error(e.message)
241246
if not kwargs["dontInlineLists"]:
242247
sq_settings = utilities.inline_lists(sq_settings, exceptions=("conditions",))
243248
__write_export(sq_settings, kwargs[options.REPORT_FILE], kwargs[options.FORMAT])
@@ -251,9 +256,9 @@ def __export_config_async(endpoint: platform.Platform, what: list[str], **kwargs
251256

252257
def __export_config(endpoint: platform.Platform, what: list[str], **kwargs) -> None:
253258
if kwargs[options.KEYS] or options.WHAT_PROJECTS not in what:
254-
__export_config_async(endpoint=endpoint, what=what, **kwargs)
255-
else:
256259
__export_config_sync(endpoint=endpoint, what=what, **kwargs)
260+
else:
261+
__export_config_async(endpoint=endpoint, what=what, **kwargs)
257262

258263

259264
def __import_config(endpoint: platform.Platform, what: list[str], **kwargs) -> None:

0 commit comments

Comments
 (0)