Skip to content

Commit 916ca9b

Browse files
committed
fix: address Bugbot review - fix indentation and spurious blank line
1. Indent continuation lines with '\n ' to match ApiError.format() indent 2. Only add separator blank line when originalDetail exists 3. Remove duplicate function body left from previous edit
1 parent 8b9bc50 commit 916ca9b

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/commands/issue/list.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -911,10 +911,10 @@ function build400Detail(
911911
originalDetail: string | undefined,
912912
flags: Pick<ListFlags, "query" | "period">
913913
): string {
914-
const parts: string[] = [];
914+
const lines: string[] = [];
915915

916916
if (originalDetail) {
917-
parts.push(originalDetail);
917+
lines.push(originalDetail);
918918
}
919919

920920
const suggestions: string[] = [];
@@ -933,15 +933,18 @@ function build400Detail(
933933
"Verify you have access to the target project: sentry project list <org>/"
934934
);
935935

936-
if (suggestions.length > 0) {
937-
parts.push("");
938-
parts.push("Suggestions:");
939-
for (const s of suggestions) {
940-
parts.push(` • ${s}`);
941-
}
936+
// Only add the separator when there's a detail line preceding the suggestions
937+
if (lines.length > 0) {
938+
lines.push("");
939+
}
940+
lines.push("Suggestions:");
941+
for (const s of suggestions) {
942+
lines.push(` • ${s}`);
942943
}
943944

944-
return parts.join("\n");
945+
// ApiError.format() prepends "\n " only before the first line of detail.
946+
// Indent continuation lines to maintain alignment with the first line.
947+
return lines.join("\n ");
945948
}
946949

947950
/**

0 commit comments

Comments
 (0)