custom status possible
This commit is contained in:
parent
fcf90f9f81
commit
e3e7b7b5f7
@ -72,7 +72,11 @@ def application(env, start_response):
|
||||
return htmlresp(400, 'La fonction <em>{}</em> demande les arguments suivants : {}. On a uniquement {}.'.format(function, params, ), start_response)
|
||||
|
||||
try:
|
||||
return htmlresp(200, str(f(**params)), start_response, False)
|
||||
response = f(**params)
|
||||
if type(response) is tuple:
|
||||
return htmlresp(response[0], str(response[1]), start_response, False)
|
||||
else:
|
||||
return htmlresp(200, str(response), start_response, False)
|
||||
except Exception:
|
||||
return htmlresp(400, 'Erreur à l’exécution de la fonction <em>{}</em>.'.format(function), start_response)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user