fix(frida): name the argument each Frida input error rejects (#2217)
Frida session lookups, script lookups, unreadable script files and the instrument-with-frida PID and script checks returned invalid_request with no issues, while the remediation told callers to correct the listed arguments. Attach the session_id, script_id, path, target or script issue with the reason so CLI and MCP callers can see what to fix. Fixes #2213 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
109769319a
commit
86de439ba4
@@ -0,0 +1,27 @@
|
||||
import { AnalysisInputError } from "../../domain/analysisErrorCore.js";
|
||||
|
||||
/** A session ID that names no open Frida session owned by this process. */
|
||||
export const unknownFridaSession = (
|
||||
operation: string,
|
||||
sessionId: string,
|
||||
): AnalysisInputError =>
|
||||
new AnalysisInputError(operation, undefined, [
|
||||
{
|
||||
path: ["session_id"],
|
||||
reason: "invalid_value",
|
||||
message: `No open Frida session ${sessionId}; start one with start_frida_session.`,
|
||||
},
|
||||
]);
|
||||
|
||||
/** A script ID that names no loaded script in the selected session. */
|
||||
export const unknownFridaScript = (
|
||||
operation: string,
|
||||
scriptId: string,
|
||||
): AnalysisInputError =>
|
||||
new AnalysisInputError(operation, undefined, [
|
||||
{
|
||||
path: ["script_id"],
|
||||
reason: "invalid_value",
|
||||
message: `No loaded Frida script ${scriptId} in this session.`,
|
||||
},
|
||||
]);
|
||||
Reference in New Issue
Block a user