Enhance error handling in scodoc7 decorator.
This commit is contained in:
parent
6b43456a71
commit
5b76654b7b
@ -186,7 +186,10 @@ def scodoc7func(func):
|
|||||||
arg_names = argspec.args
|
arg_names = argspec.args
|
||||||
for arg_name in arg_names: # pour chaque arg de la fonction vue
|
for arg_name in arg_names: # pour chaque arg de la fonction vue
|
||||||
# peut produire une KeyError s'il manque un argument attendu:
|
# peut produire une KeyError s'il manque un argument attendu:
|
||||||
|
try:
|
||||||
v = req_args[arg_name]
|
v = req_args[arg_name]
|
||||||
|
except KeyError as exc:
|
||||||
|
raise ScoValueError(f"argument {arg_name} manquant") from exc
|
||||||
# try to convert all arguments to INTEGERS
|
# try to convert all arguments to INTEGERS
|
||||||
# necessary for db ids and boolean values
|
# necessary for db ids and boolean values
|
||||||
try:
|
try:
|
||||||
|
@ -15,4 +15,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p style="margin-top: 32px;" class="help">
|
||||||
|
Si le problème persiste, merci de contacter le support ScoDoc via
|
||||||
|
<a class="stdlink" noreferer href="{{scu.SCO_DISCORD_ASSISTANCE|safe}}">
|
||||||
|
{{scu.SCO_DISCORD_ASSISTANCE}}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user