MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / outerOperationGood

Function outerOperationGood

common/src/util/__tests__/error-abort.test.ts:524–534  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

522 }
523
524 async function outerOperationGood(): Promise<string> {
525 try {
526 return await middleOperation()
527 } catch (error) {
528 // GOOD: rethrows abort error
529 if (isAbortError(error)) {
530 throw error
531 }
532 return 'default value'
533 }
534 }
535
536 it('bad pattern swallows abort', async () => {
537 const result = await outerOperationBad()

Callers 1

Calls 2

isAbortErrorFunction · 0.90
middleOperationFunction · 0.85

Tested by

no test coverage detected