Skip to content

Commit 13e1be7

Browse files
authored
Merge pull request #110 from yldm-tech/fix/109-silent-error-swallowing
[Security] Propagate non-transient security analysis errors (#109)
2 parents 476f167 + a67a5db commit 13e1be7

2 files changed

Lines changed: 70 additions & 52 deletions

File tree

packages/core/src/application/services/impactAnalysisService.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,25 @@ export class ImpactAnalysisService {
9494
}
9595
} catch (error) {
9696
const errorMessage = error instanceof Error ? error.message : String(error)
97-
logger.warn(`Security impact analysis failed for ${packageName}`, {
97+
const isTransient =
98+
errorMessage.includes('timeout') ||
99+
errorMessage.includes('ECONNREFUSED') ||
100+
errorMessage.includes('ETIMEDOUT')
101+
102+
// SEC-001: Non-transient errors (e.g., schema validation) should propagate
103+
// Transient errors (network timeout) are handled gracefully with analysisIncomplete
104+
if (!isTransient) {
105+
logger.error(`Non-transient security analysis error for ${packageName}`, {
106+
packageName,
107+
currentVersion,
108+
newVersion,
109+
error: errorMessage,
110+
})
111+
throw error
112+
}
113+
114+
// Transient error: log and return incomplete analysis
115+
logger.warn(`Transient security analysis error for ${packageName}`, {
98116
packageName,
99117
currentVersion,
100118
newVersion,

pnpm-lock.yaml

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)