fix(ghidra): keep JVM warnings out of LaunchSupport output (#1698)
* fix(ghidra): keep JVM warnings out of LaunchSupport output Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ghidra): retain LaunchSupport warnings in session diagnostics * fix(ghidra): select helper logging flags by observed JVM identity * fix(ghidra): preserve diagnostics through typed failure projection --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
morluto
parent
0043d9b134
commit
e20994a8ea
@@ -541,6 +541,9 @@ export const createGhidraProviderClient = (input: {
|
||||
environment: input.environment,
|
||||
analyzeHeadlessPath: prerequisites.value.analyzeHeadlessPath,
|
||||
javaHome: prerequisites.value.javaHome,
|
||||
...(installation.javaVmName === undefined
|
||||
? {}
|
||||
: { javaVmName: installation.javaVmName }),
|
||||
bridgeScriptPath: fileURLToPath(
|
||||
new URL("../../bridge/ghidra/ReaGhidraBridge.java", import.meta.url),
|
||||
),
|
||||
@@ -980,37 +983,40 @@ const projectPrimarySessionError = (
|
||||
failure: GhidraSessionError,
|
||||
startupTimeoutMs: number,
|
||||
): AnalysisError => {
|
||||
const context = { cause: failure, diagnostics: failure.diagnostics };
|
||||
if (failure.cause instanceof AnalysisAccessDeniedError)
|
||||
return new AnalysisAccessDeniedError(
|
||||
operation,
|
||||
failure.cause.path,
|
||||
failure.cause.systemCode,
|
||||
{ cause: failure },
|
||||
context,
|
||||
);
|
||||
if (failure.cause instanceof AnalysisArtifactChangedError)
|
||||
return new AnalysisArtifactChangedError(
|
||||
operation,
|
||||
failure.cause.path,
|
||||
failure.cause.reason,
|
||||
{ cause: failure },
|
||||
context,
|
||||
);
|
||||
if (
|
||||
operation === "annotate_native_function" &&
|
||||
failure.kind === "remote" &&
|
||||
failure.remoteCode === "invalid_function_name"
|
||||
)
|
||||
return new AnalysisInputError(operation, { cause: failure }, [
|
||||
return new AnalysisInputError(operation, context, [
|
||||
{ path: ["name"], reason: "invalid_value", message: failure.message },
|
||||
]);
|
||||
if (failure.kind === "cancelled")
|
||||
return new AnalysisCancelledError(operation);
|
||||
if (
|
||||
failure.kind === "cancelled" ||
|
||||
(failure.kind === "remote" && failure.remoteCode === "decompile_cancelled")
|
||||
)
|
||||
return new AnalysisCancelledError(operation, context);
|
||||
if (failure.kind === "timeout" || failure.kind === "analysis_timeout")
|
||||
return new AnalysisTimeoutError(
|
||||
operation,
|
||||
failure.timeoutMs ?? startupTimeoutMs,
|
||||
context,
|
||||
);
|
||||
if (failure.kind === "remote" && failure.remoteCode === "decompile_cancelled")
|
||||
return new AnalysisCancelledError(operation);
|
||||
if (
|
||||
failure.kind === "remote" &&
|
||||
failure.remoteCode === "regex_stack_exhausted"
|
||||
@@ -1021,7 +1027,7 @@ const projectPrimarySessionError = (
|
||||
failure.message,
|
||||
null,
|
||||
{
|
||||
cause: failure,
|
||||
...context,
|
||||
remediationAction:
|
||||
"Retry this search in literal mode or simplify the regex. The active analysis session and annotations remain available.",
|
||||
},
|
||||
@@ -1032,7 +1038,7 @@ const projectPrimarySessionError = (
|
||||
failure.remoteCode ?? "",
|
||||
)
|
||||
)
|
||||
return new AnalysisInputError(operation, { cause: failure }, [
|
||||
return new AnalysisInputError(operation, context, [
|
||||
{ path: [], reason: "invalid_value", message: failure.message },
|
||||
]);
|
||||
if (failure.kind === "remote" && failure.remoteCode === "method_unavailable")
|
||||
@@ -1040,9 +1046,7 @@ const projectPrimarySessionError = (
|
||||
"ghidra",
|
||||
operation,
|
||||
failure.message,
|
||||
context,
|
||||
);
|
||||
return new ProviderAdapterError("ghidra", operation, {
|
||||
cause: failure,
|
||||
diagnostics: failure.diagnostics,
|
||||
});
|
||||
return new ProviderAdapterError("ghidra", operation, context);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user