Skip to content

Commit 7f27e3f

Browse files
committed
Detect and show no error for intentional connection close/reset
1 parent 58f4e66 commit 7f27e3f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/components/view/http/http-error-header.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export const HttpErrorHeader = (p: {
4545
DESKTOP_HEADER_LIMIT_CONFIGURABLE
4646
);
4747

48+
// We don't bother explaining errors we triggered ourselves (breakpoint or
49+
// close/reset rule aborts).
50+
if (p.type === 'rule-abort') return;
51+
4852
return <HeaderCard>
4953
<HeaderText>
5054
<WarningIcon /> {

src/model/http/error-types.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type ErrorType =
1212
| 'dns-error'
1313
| 'connection-refused'
1414
| 'connection-reset'
15+
| 'rule-abort'
1516
| 'client-abort'
1617
| 'server-timeout'
1718
| 'client-timeout'
@@ -153,6 +154,20 @@ export function tagsToErrorType(tags: string[]): ErrorType | undefined {
153154
tags.includes("client-error:EPIPE")
154155
) return 'client-abort';
155156

157+
if (
158+
// Request breakpoint close/reset:
159+
tags.includes("passthrough-error:E_RULE_BREQ_CLOSE") ||
160+
tags.includes("passthrough-error:E_RULE_BREQ_RESET") ||
161+
// Response breakpoint close/reset:
162+
tags.includes("passthrough-error:E_RULE_BRES_CLOSE") ||
163+
tags.includes("passthrough-error:E_RULE_BRES_RESET") ||
164+
// Close/reset rule:
165+
tags.includes("passthrough-error:E_RULE_CLOSE") ||
166+
tags.includes("passthrough-error:E_RULE_RESET")
167+
) {
168+
return 'rule-abort';
169+
}
170+
156171
if (
157172
tags.filter(t => t.startsWith("passthrough-error:")).length > 0 ||
158173
tags.filter(t => t.startsWith("client-error:")).length > 0

0 commit comments

Comments
 (0)