Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#1782 from yanCode/fix/json-format
Browse files Browse the repository at this point in the history
fix: the display format of json error
  • Loading branch information
Yidadaa authored Jun 1, 2023
2 parents c198c33 + 6bbdaf7 commit 6502855
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/utils/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ export function prettyObject(msg: any) {
if (msg === "{}") {
return obj.toString();
}
if (msg.startsWith("```json")) {
return msg;
}
return ["```json", msg, "```"].join("\n");
}

0 comments on commit 6502855

Please sign in to comment.