mirror of https://github.com/nucypher/nucypher.git
adjust missing condition context variable HTTP error
parent
e5fb972d2a
commit
af3820bdb4
|
@ -237,9 +237,9 @@ def _make_rest_app(datastore: Datastore, this_node, log: Logger) -> Flask:
|
||||||
log.info(f'Evaluating decryption condition')
|
log.info(f'Evaluating decryption condition')
|
||||||
lingo.eval(**context)
|
lingo.eval(**context)
|
||||||
except RequiredContextVariable as e:
|
except RequiredContextVariable as e:
|
||||||
message = f"Missing required inputs - {e}" # TODO: be more specific and name the missing inputs, etc
|
message = f"Missing required inputs - {e}"
|
||||||
# TODO BAD_REQUEST instead of FORBIDDEN?
|
# TODO: be more specific and name the missing inputs, etc
|
||||||
error = (message, HTTPStatus.FORBIDDEN)
|
error = (message, HTTPStatus.BAD_REQUEST)
|
||||||
log.info(message)
|
log.info(message)
|
||||||
return Response(str(e), status=error[1])
|
return Response(str(e), status=error[1])
|
||||||
except InvalidContextVariableData as e:
|
except InvalidContextVariableData as e:
|
||||||
|
|
Loading…
Reference in New Issue