feat(ghidra): add private headless provider session
This commit is contained in:
+18
-2
@@ -212,16 +212,26 @@ const providerSelectionUserMessage = (
|
||||
}
|
||||
};
|
||||
|
||||
/** A provider adapter failed outside its more precise typed variants. */
|
||||
export interface ProviderAdapterErrorOptions extends ErrorOptions {
|
||||
readonly diagnostics?: Readonly<Record<string, JsonValue>>;
|
||||
}
|
||||
|
||||
/** A provider adapter failed outside its more precise typed variants. */
|
||||
export class ProviderAdapterError extends AnalysisError {
|
||||
readonly _tag = "ProviderAdapterError";
|
||||
readonly diagnostics: Readonly<Record<string, JsonValue>> | undefined;
|
||||
|
||||
constructor(
|
||||
readonly providerId: string,
|
||||
readonly operation: string,
|
||||
options?: ErrorOptions,
|
||||
options: ProviderAdapterErrorOptions = {},
|
||||
) {
|
||||
super(`Provider ${providerId} adapter failed during ${operation}`, options);
|
||||
this.diagnostics =
|
||||
options.diagnostics === undefined
|
||||
? undefined
|
||||
: structuredClone(options.diagnostics);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -702,7 +712,13 @@ const errorDetails = (
|
||||
})),
|
||||
};
|
||||
if (error instanceof ProviderAdapterError)
|
||||
return { provider_id: error.providerId, operation: error.operation };
|
||||
return {
|
||||
provider_id: error.providerId,
|
||||
operation: error.operation,
|
||||
...(error.diagnostics === undefined
|
||||
? {}
|
||||
: { diagnostics: error.diagnostics }),
|
||||
};
|
||||
if (error instanceof BrowserObservationError)
|
||||
return { operation: error.operation, reason: error.reason };
|
||||
if (error instanceof HopperRemoteError)
|
||||
|
||||
Reference in New Issue
Block a user