Code Review
/
ric-plt
/
a1.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix missing 400 impl, update test manifest
[ric-plt/a1.git]
/
a1
/
controller.py
diff --git
a/a1/controller.py
b/a1/controller.py
index
ca9618b
..
b3bbcdb
100644
(file)
--- a/
a1/controller.py
+++ b/
a1/controller.py
@@
-17,6
+17,7
@@
from flask import Response
import connexion
import json
from flask import Response
import connexion
import json
+from jsonschema.exceptions import ValidationError
from a1 import get_module_logger
from a1 import a1rmr, exceptions, utils
from a1 import get_module_logger
from a1 import a1rmr, exceptions, utils
@@
-47,6
+48,9
@@
def _try_func_return(func):
"""
try:
return func()
"""
try:
return func()
+ except ValidationError as exc:
+ logger.exception(exc)
+ return "", 400
except exceptions.PolicyNotFound as exc:
logger.exception(exc)
return "", 404
except exceptions.PolicyNotFound as exc:
logger.exception(exc)
return "", 404