Skip to content

Commit 77372b9

Browse files
Escape byte values from JSON payload of the API we call when we write to a file to prevent files from turning into binaries.
1 parent 2f27bb8 commit 77372b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/media-import/status.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ function buildFileErrors(
147147

148148
let errorString = '';
149149
for ( const fileError of fileErrors ) {
150-
errorString += `File Name: ${ fileError?.fileName ?? 'N/A' }`;
151-
errorString += `\n\nErrors:\n\t- ${
150+
errorString += `File Name: ${ JSON.stringify( fileError?.fileName ?? 'N/A' ) }`;
151+
errorString += `\n\nErrors:\n\t- ${ JSON.stringify(
152152
fileError?.errors?.join( ', ' ) ?? 'unknown error'
153-
}\n\n\n\n`;
153+
) }\n\n\n\n`;
154154
}
155155
return errorString;
156156
}

0 commit comments

Comments
 (0)