mirror of
https://github.com/morluto/rea.git
synced 2026-11-17 04:04:25 +00:00
fix(cli): retain Evidence receipts on format refusal (#9943)
This commit is contained in:
1 parent
a54e848302
commit
7aaff2e4e4
2 files changed
+59
-20
No files matched your search
+24
-20
@@ -556,28 +556,32 @@ export const createCliResultOutput = (
|
||||
const selected = selection.value;
|
||||
const refuseUnrepresentableText = async (): Promise<true> => {
|
||||
error = projectAnalysisError(
|
||||
new AnalysisInputError(
|
||||
metadata.command,
|
||||
{
|
||||
userMessage:
|
||||
format === "md"
|
||||
? "Markdown cannot preserve NUL or unpaired UTF-16 surrogates in rendered output."
|
||||
: "TOON cannot preserve unpaired UTF-16 surrogates in UTF-8 output.",
|
||||
remediationAction:
|
||||
"Use --format json or --format yaml to retain the exact code units.",
|
||||
...(completed?.originalFailure === undefined
|
||||
? {}
|
||||
: {
|
||||
diagnostics: { original_failure: completed.originalFailure },
|
||||
}),
|
||||
},
|
||||
[
|
||||
retainCliPublicationOnError(
|
||||
new AnalysisInputError(
|
||||
metadata.command,
|
||||
{
|
||||
path: ["--format"],
|
||||
reason: "invalid_value",
|
||||
message: "The selected format cannot preserve this value.",
|
||||
userMessage:
|
||||
format === "md"
|
||||
? "Markdown cannot preserve NUL or unpaired UTF-16 surrogates in rendered output."
|
||||
: "TOON cannot preserve unpaired UTF-16 surrogates in UTF-8 output.",
|
||||
remediationAction:
|
||||
"Use --format json or --format yaml to retain the exact code units.",
|
||||
...(completed?.originalFailure === undefined
|
||||
? {}
|
||||
: {
|
||||
diagnostics: {
|
||||
original_failure: completed.originalFailure,
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
path: ["--format"],
|
||||
reason: "invalid_value",
|
||||
message: "The selected format cannot preserve this value.",
|
||||
},
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
const document = options.fullOutput
|
||||
|
||||
Reference in new issue
Block a user