How to Aggregate Errors on Tasks?
See original GitHub issueThis is a use case I haven’t been able to solve.
I have 3 http requests, if one fails, I want, at least, the result of the other 2. Ideally, I would want to know what error happened.
I’m still using data.task from folktale 1, and this is how I do the requests, which fails fast (if one fails, I only get the first error with no result):
const mergeResults = data => logs => customer => ({ data, logs, customer })
liftA3(
mergeResults,
getDataFromAPI(userId),
getLogs(userId),
getCustomer(customerID)
).fork(
error => ... Handle the first thrown error,
result => ... All 3 requests succeeded here
)
Here, I would like to have data
and logs
returned if getCustomer
API call fails.
Thanks in advance
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Exception handling (Task Parallel Library) - Microsoft Learn
Explore exception handling using the Task Parallel Library (TPL) in .NET. See nested aggregate exceptions, inner exceptions, unobserved task ...
Read more >AggregateError - David Walsh Blog
The AggregateError error lets developers throw multiple errors within one single Error . Let's see how it works. Website performance monitoring.
Read more >How to use the Aggregate Function to remove errors in data in ...
How to use the Aggregate Function to remove errors in data in ExcelHow to use the Aggregate Function for data with errors and...
Read more >Handling exceptions in aggregation flows - IBM
Complete the following tasks: ... If an error is detected downstream of an AggregateReply node, the integration node issues an exception.
Read more >Aggregate Error Messages In a Calculation Editor
Use a Level of Detail (LOD) Expression to make an aggregation non-aggregate. All LOD expression return non-aggregated values. [Sales]/SUM( [ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh! So you want individual results rather than the overall results. That’s easier.
With:
And use it as:
Here each value of the results record will be a Validation, however, so you’ll need to pattern match on whether each individual result is a failure or a success.
Sorry for suddenly jump in. I’ve recently needed something like this, but with plain promises.