mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Exception handling
This commit is contained in:
parent
cd30ef9b35
commit
60a27e4a1f
1 changed files with 6 additions and 2 deletions
6
yunohost
6
yunohost
|
@ -87,7 +87,11 @@ for category, info in parser_array.items():
|
||||||
subparsers_action[category] = subparsers_category[category].add_subparsers()
|
subparsers_action[category] = subparsers_category[category].add_subparsers()
|
||||||
for action, helper in info['actions'].items():
|
for action, helper in info['actions'].items():
|
||||||
parsers[category + '_' + action] = subparsers_action[category].add_parser(action, help = helper)
|
parsers[category + '_' + action] = subparsers_action[category].add_parser(action, help = helper)
|
||||||
parsers[category + '_' + action].set_defaults(func=str2fun(category + '_' + action))
|
try:
|
||||||
|
parsers[category + '_' + action].set_defaults(func=str2fun(category + '_' + action))
|
||||||
|
except AttributeError:
|
||||||
|
print 'Error: Function ' + category + '_' + action + '() has not been defined'
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
Loading…
Add table
Reference in a new issue