diff --git a/scripts/verify/baselines/cleanup-dependency-binding.json b/scripts/verify/baselines/cleanup-dependency-binding.json index a2468550dc..1c2ccc6f34 100644 --- a/scripts/verify/baselines/cleanup-dependency-binding.json +++ b/scripts/verify/baselines/cleanup-dependency-binding.json @@ -15,7 +15,6 @@ "src/hopper/HopperAnalysisProfile.ts": 1, "src/hopper/HopperImageCopy.ts": 1, "src/ida/IdaSessionClient.ts": 1, - "src/inspector/V8InspectorProvider.ts": 1, "src/javascript/sourceMaps/SourceMapCommand.ts": 4, "src/jeb/JebMcpConnectionOwner.ts": 1, "src/jeb/JebProvider.ts": 1, diff --git a/src/inspector/V8InspectorProvider.ts b/src/inspector/V8InspectorProvider.ts index 9bcbd13c84..b815327d84 100644 --- a/src/inspector/V8InspectorProvider.ts +++ b/src/inspector/V8InspectorProvider.ts @@ -25,8 +25,10 @@ import { } from "../domain/analysisErrorCore.js"; import { BrowserObservationError } from "../domain/browserObservationError.js"; import { ProviderAdapterError } from "../domain/providerAdapterError.js"; -import { ProviderCleanupError } from "../domain/providerCleanupError.js"; -import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js"; +import { + analysisErrorWithCleanupFailure, + providerCleanupErrorFromFailures, +} from "../domain/analysisErrorCleanup.js"; import type { BrowserObservationOperation } from "../domain/browserObservationErrors.js"; import { err, ok, type Result } from "../domain/result.js"; import { delayWithCancellation } from "../browser/CdpCaptureValues.js"; @@ -132,20 +134,15 @@ export class V8InspectorAdmission { } if (failures.length === 0) return; if (failures.length === 1) throw failures[0]!; - const cleanup = new ProviderCleanupError( + throw providerCleanupErrorFromFailures( V8_INSPECTOR_PROVIDER_IDENTITY.id, - failures.flatMap(({ cleanupResources }) => cleanupResources), - { reason: "Inspector provider cleanup remains incomplete." }, + failures, + "Inspector provider cleanup remains incomplete.", { operation: "observe_javascript_runtime", - cause: new AggregateError( - failures, - "Inspector provider cleanup owners remain unresolved.", - ), + message: "Inspector provider cleanup owners remain unresolved.", }, ); - cleanup.bindCleanupDependencies(failures); - throw cleanup; } finally { this.#closing = false; }