{"record":{"id":"9d4e9a624ed252ca","repo":"apache/beam","slug":"processcontinuation-must-be-the-final-non-error-return","errorCode":null,"errorMessage":"ProcessContinuation must be the final non-error return parameter","messagePattern":"ProcessContinuation must be the final non-error return parameter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/funcx/fn.go","lineNumber":749,"sourceCode":"\tcase FnRTracker:\n\t\treturn -1, errRTrackerPrecedence\n\tcase FnStateProvider:\n\t\treturn -1, errStateProviderPrecedence\n\tcase FnTimerProvider:\n\t\treturn -1, errTimerProviderPrecedence\n\tcase FnIter, FnReIter, FnValue, FnMultiMap:\n\t\treturn psInput, nil\n\tcase FnEmit:\n\t\treturn psOutput, nil\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"library error, unknown ParamKind: %v\", transition))\n\t}\n}\n\nvar (\n\terrEventTimeRetPrecedence        = errors.New(\"beam.EventTime must be first return parameter\")\n\terrErrorPrecedence               = errors.New(\"error must be the final return parameter\")\n\terrProcessContinuationPrecedence = errors.New(\"ProcessContinuation must be the final non-error return parameter\")\n)\n\ntype retState int\n\nconst (\n\trsStart retState = iota\n\trsEventTime\n\trsOutput\n\trsError\n\trsProcessContinuation\n)\n\nfunc nextRetState(cur retState, transition ReturnKind) (retState, error) {\n\tswitch cur {\n\tcase rsStart:\n\t\tswitch transition {\n\t\tcase RetEventTime:\n\t\t\treturn rsEventTime, nil","sourceCodeStart":731,"sourceCodeEnd":767,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/funcx/fn.go#L731-L767","documentation":"Sentinel error errProcessContinuationPrecedence from the funcx return-value state machine: in the rsOutput state, a return kind other than the allowed terminal transitions (such as another value after ProcessContinuation was already emitted) was encountered. ProcessContinuation, when returned by a splittable DoFn's ProcessElement, must be the final non-error return value.","triggerScenarios":"Thrown at sdks/go/pkg/beam/core/funcx/fn.go:749 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reorder returns so ProcessContinuation is the last non-error return value, with error (if any) after it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}