better error message

This commit is contained in:
Emmanuel Garette 2020-08-26 15:31:54 +02:00
parent ca101cf094
commit dc7d081608
1 changed files with 4 additions and 0 deletions

View File

@ -1,7 +1,9 @@
try:
from tiramisu3 import Config
from tiramisu3.error import ValueOptionError
except:
from tiramisu import Config
from tiramisu.error import ValueOptionError
from traceback import print_exc
from copy import copy
from typing import Dict, Callable, List, Optional
@ -259,6 +261,8 @@ class Dispatcher(register.RegisterDispatcher,
if get_config()['global']['debug']:
print_exc()
raise ValueError(_(f'unknown parameter in "{uri}": "{key}"'))
except ValueOptionError as err:
raise ValueError(_(f'invalid parameter in "{uri}": {err}'))
else:
extra_parameters[key] = value
# check mandatories options