Skip to content

Commit 5966ff8

Browse files
committed
do not overwrap errors
1 parent 9d97dc6 commit 5966ff8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

cmd/dbos/workflow.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,7 @@ func runWorkflowGet(cmd *cobra.Command, args []string) error {
213213
return fmt.Errorf("workflow not found: %s", workflowID)
214214
}
215215

216-
status := workflows[0]
217-
218-
// Output results as JSON
219-
return outputJSON(status)
216+
return outputJSON(workflows[0])
220217
}
221218

222219
func runWorkflowSteps(cmd *cobra.Command, args []string) error {
@@ -267,7 +264,7 @@ func runWorkflowCancel(cmd *cobra.Command, args []string) error {
267264
// Cancel workflow
268265
err = ctx.CancelWorkflow(ctx, workflowID)
269266
if err != nil {
270-
return fmt.Errorf("failed to cancel workflow: %w", err)
267+
return err
271268
}
272269
logger.Info("Successfully cancelled workflow", "id", workflowID)
273270
return nil
@@ -291,7 +288,7 @@ func runWorkflowResume(cmd *cobra.Command, args []string) error {
291288
// Resume workflow
292289
handle, err := ctx.ResumeWorkflow(ctx, workflowID)
293290
if err != nil {
294-
return fmt.Errorf("failed to resume workflow: %w", err)
291+
return err
295292
}
296293

297294
// Get status
@@ -331,7 +328,7 @@ func runWorkflowFork(cmd *cobra.Command, args []string) error {
331328
StartStep: uint(step),
332329
})
333330
if err != nil {
334-
return fmt.Errorf("failed to fork workflow: %w", err)
331+
return err
335332
}
336333

337334
// Get status of forked workflow

0 commit comments

Comments
 (0)