Errors Endpoint
TheFo2sh opened this issue · comments
New Endpoint Proposal: Fetching Job Errors
Issue Type: Feature Request
Description:
As we continue to evolve the AsyncFlow library, it's become apparent that there's a potential gap in our error-handling capabilities. Currently, while users can track the status of their jobs, there isn't a straightforward way to fetch detailed error information in case a job fails. This can be invaluable for both developers and end-users to understand what might have gone wrong.
Proposal:
Introduce a new endpoint:
/{flowName}/{jobId}/error
This endpoint will return detailed error information if the corresponding job encounters a failure.
Response Structure (proposed):
{
"JobId": "unique-job-id",
"Error": {
"Type": "ExceptionType",
"Message": "Detailed error message",
"StackTrace": "Stack trace details..."
}
}
Customization:
In line with the ethos of flexibility that AsyncFlow offers, we should also provide users with the ability to customize the error response. This can be achieved by incorporating a Func<Exception, IResult>
within the AsyncFlowEndpointConfigurator
, allowing users to modify the default error output or even introduce additional logging mechanisms.
Benefits:
- Provides clearer insights into job failures.
- Enhances user experience by offering detailed feedback.
- Allows users to tailor error outputs, making it adaptable for various applications.
Implementation Steps (tentative):
- Design the endpoint structure.
- Integrate it with the job execution flow to capture and relay errors.
- Implement the customization mechanism through
AsyncFlowEndpointConfigurator
. - Update documentation and provide examples.