I'd like to propose a potential improvement to the way errors are handled when propagating from microflows to nanoflows. Currently, while error events trigger correctly, accessing the specific error information within the calling nanoflow can be challenging. This limits the granularity with which we can handle errors at the nanoflow level.
My suggestion is to allow error end events in microflows to return a string value, similar to a standard end event. This string could then be populated into the $latestError
variable within the calling nanoflow.
Benefits:
$latestError
variable in the nanoflow would then contain this detailed message, providing more actionable information for the nanoflow's error handling logic.Essentially, this would provide a mechanism to surface useful, developer-defined error context from microflows to nanoflows, leading to more robust and maintainable applications.