X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2common%2Fviews%2Froute_exception.py;h=ccb439b8572e1fe226cb80d598c00f37aed99b70;hb=8e89a87636fc99053dedb55c3daee85ede4a2953;hp=07a60a366c6245e9fbb99eef1f805fcdee4939c3;hpb=46d810e671d23449e36f1c5d78e5e725ff06a7ac;p=pti%2Fo2.git diff --git a/o2common/views/route_exception.py b/o2common/views/route_exception.py index 07a60a3..ccb439b 100644 --- a/o2common/views/route_exception.py +++ b/o2common/views/route_exception.py @@ -85,3 +85,9 @@ def configure_exception(app): '''Return a custom message and 500 status code''' problem = ProblemDetails(500, "Internal Server Error") return problem.serialize(), 500 + + @app.errorhandler(Exception) + def handle_general_exception(error): + '''Return a custom message and 500 status code''' + problem = ProblemDetails(500, "Internal Server Error") + return problem.serialize(), 500