{"record":{"id":"51cbea3f64ceab74","repo":"larksuite/cli","slug":"round-trip-aborted-by-extension","errorCode":null,"errorMessage":"round trip aborted by extension","messagePattern":"round trip aborted by extension","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"extension/transport/errors.go","lineNumber":16,"sourceCode":"// Copyright (c) 2026 Lark Technologies Pte. Ltd.\n// SPDX-License-Identifier: MIT\n\npackage transport\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\n// ErrAborted is a sentinel matched by errors.Is on any extension-triggered\n// round-trip abort. Callers that only need to know whether an error was\n// caused by an extension interception should use:\n//\n//\tif errors.Is(err, transport.ErrAborted) { ... }\nvar ErrAborted = errors.New(\"round trip aborted by extension\")\n\n// AbortError is returned by the built-in middleware when an AbortableInterceptor\n// short-circuits a request via PreRoundTripE. It wraps the extension's original\n// reason and carries the extension's Provider.Name() for traceability.\n//\n// Use errors.As to recover the typed error:\n//\n//\tvar aErr *transport.AbortError\n//\tif errors.As(err, &aErr) {\n//\t    log.Printf(\"blocked by %s: %v\", aErr.Extension, aErr.Reason)\n//\t}\n//\n// errors.Is(err, transport.ErrAborted) also works, and errors.Is against the\n// inner reason still works via Unwrap.\ntype AbortError struct {\n\t// Extension is the name of the Provider whose interceptor aborted the\n\t// request (from Provider.Name()). May be empty if the provider did not\n\t// supply a name.","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/extension/transport/errors.go#L1-L34","documentation":"Package-level sentinel in extension/transport marking that an AbortableInterceptor short-circuited a request via PreRoundTripE; the built-in middleware returns *AbortError, whose Is method matches this sentinel at any nesting depth. It is a classification handle rather than a direct failure: it fires whenever any extension deliberately cancels a round trip.","triggerScenarios":"Thrown at extension/transport/errors.go:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Match with errors.Is(err, transport.ErrAborted) and treat it as an extension-declared cancellation, not a transport failure","Inspect the wrapped *AbortError.Reason for the extension's specific cause before reporting"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}