mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
return error message in response
This commit is contained in:
parent
3bb3211d4a
commit
ddcdff611e
1 changed files with 9 additions and 4 deletions
|
|
@ -43,14 +43,19 @@ class TimersManagerModuleRestApi:
|
|||
asset_name = data["asset_name"]
|
||||
task_name = data["task_name"]
|
||||
except KeyError:
|
||||
log.error((
|
||||
msg = (
|
||||
"Payload must contain fields 'project_name,"
|
||||
" 'asset_name' and 'task_name'"
|
||||
))
|
||||
return Response(status=400)
|
||||
)
|
||||
log.error(msg)
|
||||
return Response(status=400, message=msg)
|
||||
|
||||
self.module.stop_timers()
|
||||
self.module.start_timer(project_name, asset_name, task_name)
|
||||
try:
|
||||
self.module.start_timer(project_name, asset_name, task_name)
|
||||
except Exception as exc:
|
||||
return Response(status=404, message=str(exc))
|
||||
|
||||
return Response(status=200)
|
||||
|
||||
async def stop_timer(self, request):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue