Skip to content

Commit

Permalink
Log exceptions in listTask, Fix ImageBuildSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Aug 28, 2024
1 parent 30d8053 commit 3da772c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ def serialize(model, base=None):

task["builder"] = model.builder
task["context"] = ContextSerializer.serialize(model.context)
task["destination"] = DestinationSerializer(model.destination)
task["destination"] = DestinationSerializer.serialize(model.destination)

return task
2 changes: 2 additions & 0 deletions src/api/src/backend/views/Tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def post(self, request, group_id, pipeline_id, *_, **__):
except (IntegrityError, OperationalError) as e:
return BadRequest(message=e.__cause__)
except Exception as e:
logger.exception(e.__cause__)
return ServerError(f"{e}")

return ResourceURLResponse(
Expand Down Expand Up @@ -192,6 +193,7 @@ def delete(self, request, group_id, pipeline_id, task_id):
try:
task.delete()
except Exception as e:
logger.exception(e.__cause__)
return ServerError(str(e))

return BaseResponse(message=f"Deleted task '{task_id}' on pipeline '{pipeline_id}")
Expand Down

0 comments on commit 3da772c

Please sign in to comment.