fix: wrap lines when showing error details

This commit is contained in:
Ali BARIN
2023-01-03 21:04:01 +01:00
parent 30c95da90e
commit ac671110a3
2 changed files with 6 additions and 2 deletions

View File

@@ -116,7 +116,11 @@ export default function AddAppConnection(
sx={{ mt: 1, fontWeight: 500, wordBreak: 'break-all' }}
>
{error.message}
{error.details && <pre>{JSON.stringify(error.details, null, 2)}</pre>}
{error.details && (
<pre style={{ whiteSpace: 'pre-wrap' }}>
{JSON.stringify(error.details, null, 2)}
</pre>
)}
</Alert>
)}

View File

@@ -32,7 +32,7 @@ function serializeErrors(graphQLErrors: any) {
return {
...error,
message: (
<pre style={{ margin: 0 }}>
<pre style={{ margin: 0, whiteSpace: 'pre-wrap' }}>
{JSON.stringify(JSON.parse(error.message as string), null, 2)}
</pre>
),