Commit 92f1d252 authored by cst's avatar cst
Browse files

Dont let main exception swallow BadRequest exc

parent b244e650
......@@ -33,11 +33,14 @@ def logger_post():
loggerModel = Binder.bind_and_validate(loggerHandler.get_validation_rules())
try:
obsModel = loggerHandler.handle(loggerModel)
if obsModel is None:
raise BadRequest(description="Logger id not found")
obsModel = loggerHandler.handle(loggerModel)
except Exception as e:
raise InternalServerError(description=str(e))
if obsModel is None:
raise BadRequest(description="Logger id not found")
try:
obsHandler.handle(obsModel)
return Responses.plain("Created", 201)
except Exception as e:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment