Commit 44e478d
docs: clarify afterRequest successful/failed reflect responseHandling rule (#3440)
The htmx:afterRequest docs described `detail.successful` and `detail.failed`
purely in terms of "20x status code", but the actual logic uses the matched
htmx.config.responseHandling rule's `error` flag. When users customize
responseHandling to allow non-2xx responses to swap (e.g.
`{"code":"...", "swap": true}` without `error: true`), those responses are
also marked `successful` — a behavior that surprised the issue reporter.
Updates the descriptions of both detail.successful and detail.failed to
accurately reference responseHandling, while preserving the default
"20x = successful" framing as a parenthetical default-behavior note.
Adds an explicit note about the custom responseHandling case.
No code change; this aligns documentation with the existing intentional
behavior confirmed by @MichaelWest22 in the issue.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent dbf77dd commit 44e478d
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
0 commit comments