Comment Comment by emil14 Actually error handling is much easier with agency's Processes (pipelines)Instead of writing:result, err := operationFoo(userInput) if err != nil { panic(err }result, err = operationBar(result) if err != nil { panic(err }You can create a Process and handle errors only once:result, err := agency.NewProcess(operationFoo, operationBar).Execute(userInput) // ...Imagine having 3+ operations, like 5 or 10. That's gonna be some real difference.All the chained methods like `SetPrompt(...)` returns `agency.Operation` and no error needs to be handled there parent emil14 2 years ago
Instead of writing:
result, err := operationFoo(userInput) if err != nil { panic(err }
result, err = operationBar(result) if err != nil { panic(err }
You can create a Process and handle errors only once:
result, err := agency.NewProcess(operationFoo, operationBar).Execute(userInput) // ...
Imagine having 3+ operations, like 5 or 10. That's gonna be some real difference.
All the chained methods like `SetPrompt(...)` returns `agency.Operation` and no error needs to be handled there