mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 13:12:26 +00:00
* refactor(process): build provider captured output through one owner * fix(process): report only declared diagnostics on successful provider results
22 lines
983 B
TypeScript
22 lines
983 B
TypeScript
import { capturedProviderOutput } from "../process/capturedProviderOutput.js";
|
|
import { OwnedCommandFailure } from "../process/OwnedCommand.js";
|
|
import { DarwinProcessOwnershipInspectionError } from "../process/DarwinProcessRunTokenReader.js";
|
|
import type { AnalysisCapturedOutput } from "../domain/analysisErrorBase.js";
|
|
import type { ProviderProcessSnapshot } from "../process/ProviderProcess.js";
|
|
|
|
/** The command owner selects command output or preparation output, once. */
|
|
export const capturedApktoolFailureOutput = (
|
|
cause: unknown,
|
|
): AnalysisCapturedOutput | undefined => {
|
|
if (cause instanceof OwnedCommandFailure)
|
|
return cause.snapshot === null
|
|
? cause.preparationFailure instanceof
|
|
DarwinProcessOwnershipInspectionError
|
|
? cause.preparationFailure.capturedOutput
|
|
: undefined
|
|
: capturedProviderOutput(cause.snapshot);
|
|
return cause instanceof DarwinProcessOwnershipInspectionError
|
|
? cause.capturedOutput
|
|
: undefined;
|
|
};
|