gogama / gogama/httpx

Event handlers should be able to abort Plan execution on error

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue help wanted
Dominant language
Go
Stars
16
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Currently httpx blindly continues the `Plan` execution after running the handler chain for a given event, *e.g.* [`BeforeAttempt`](https://github.com/gogama/httpx/blob/v1.1.4/client.go#L268).

This is naïve, because it assumes a handler can't run into an error itself, which is clearly wrong. A handler experiencing an error might theoretically want to/need to abort the `Plan` execution.

Handlers should be able to populate the value of `Execution.Err` and:

- If it is non-`nil` after a specific handler, the handler chain execution should *possibly* stop. [Validate if this makes sense.]
- If it is non-`nil` after a handler chain, the `Plan` execution should *probably* stop and the execution should fail.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.