Skip to content

Commit f945e3b

Browse files
committed
fix
1 parent 9852279 commit f945e3b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

dbos/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (c *client) Enqueue(queueName, workflowName string, input any, opts ...Enqu
151151
// Serialize input before storing in workflow status
152152
encodedInput, err := serialize(params.workflowInput)
153153
if err != nil {
154-
return nil, newWorkflowExecutionError(workflowID, fmt.Errorf("failed to serialize workflow input: %w", err))
154+
return nil, fmt.Errorf("failed to serialize workflow input: %w", err)
155155
}
156156

157157
status := WorkflowStatus{

dbos/workflow.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,17 @@ func (h *workflowPollingHandle[R]) GetResult(opts ...GetResultOption) (R, error)
253253
return h.dbosContext.(*dbosContext).systemDB.awaitWorkflowResult(ctx, h.workflowID)
254254
}, withRetrierLogger(h.dbosContext.(*dbosContext).logger))
255255

256-
// Deserialize the result
256+
// Deserialize the result (but preserve any error from awaitWorkflowResult)
257257
var result any
258258
if encodedResult != nil {
259259
encodedStr, ok := encodedResult.(string)
260260
if !ok {
261261
return *new(R), newWorkflowUnexpectedResultType(h.workflowID, "string (encoded)", fmt.Sprintf("%T", encodedResult))
262262
}
263-
result, err = deserialize(&encodedStr)
264-
if err != nil {
265-
return *new(R), fmt.Errorf("failed to deserialize workflow result: %w", err)
263+
var deserErr error
264+
result, deserErr = deserialize(&encodedStr)
265+
if deserErr != nil {
266+
return *new(R), fmt.Errorf("failed to deserialize workflow result: %w", deserErr)
266267
}
267268
}
268269

0 commit comments

Comments
 (0)