Skip to content

Commit 1475bfc

Browse files
committed
[core] Meaningful output of TasksDeploymentError
1 parent 20f016c commit 1475bfc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

core/task/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (r GenericTasksError) Error() string {
7272

7373
type TasksDeploymentError tasksErrorBase
7474
func (r TasksDeploymentError) Error() string {
75-
return fmt.Sprintf("deployment failed for tasks [%s]", r.taskIds)
75+
return fmt.Sprintf("deployment failed for tasks [%s]", strings.Join(r.taskIds, ", "))
7676
}
7777

7878
type TaskAlreadyReleasedError taskErrorBase

core/task/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ func (m *Manager) AcquireTasks(envId uuid.Array, taskDescriptors Descriptors) (e
260260
// While all the required roles are running, for some reason we
261261
// can't lock some of them, so we must roll back and keep them
262262
// unlocked in the roster.
263-
var deployedTaskNames []string
263+
var deployedTaskIds []string
264264
for taskPtr, _ := range deployedTasks {
265265
taskPtr.parent = nil
266-
deployedTaskNames = append(deployedTaskNames, taskPtr.name)
266+
deployedTaskIds = append(deployedTaskIds, taskPtr.taskId)
267267
}
268-
err = TasksDeploymentError{taskIds: deployedTaskNames}
268+
err = TasksDeploymentError{taskIds: deployedTaskIds}
269269
}
270270

271271
// Finally, we write to the roster. Point of no return!

0 commit comments

Comments
 (0)