From ee0690e5e53048822d8d43a4e42d3e5e0f357770 Mon Sep 17 00:00:00 2001 From: Naumov Alexey Date: Sat, 28 Nov 2020 13:42:19 +0300 Subject: [PATCH] fix(core-blocks): CB-537 change
-> \n --- .../core-blocks/src/Snackbars/SnackbarMarkups/SnackbarBody.tsx | 1 + webapp/packages/core-sdk/src/GQLError.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/packages/core-blocks/src/Snackbars/SnackbarMarkups/SnackbarBody.tsx b/webapp/packages/core-blocks/src/Snackbars/SnackbarMarkups/SnackbarBody.tsx index 49ad7ec4bf..cb388b9ad7 100644 --- a/webapp/packages/core-blocks/src/Snackbars/SnackbarMarkups/SnackbarBody.tsx +++ b/webapp/packages/core-blocks/src/Snackbars/SnackbarMarkups/SnackbarBody.tsx @@ -23,6 +23,7 @@ const SNACKBAR_BODY_STYLES = css` max-height: 200px; margin-bottom: 8px; word-break: break-word; + white-space: pre-line; } } } diff --git a/webapp/packages/core-sdk/src/GQLError.ts b/webapp/packages/core-sdk/src/GQLError.ts index 6223a1256a..581d0b891c 100644 --- a/webapp/packages/core-sdk/src/GQLError.ts +++ b/webapp/packages/core-sdk/src/GQLError.ts @@ -27,7 +27,8 @@ export class GQLError extends Error { this.isTextBody = true; this.errorText = clientError.response.error; } else { - this.errorText = clientError.response.errors?.map(e => e.message).join('
') || 'unknown error'; + this.errorText = clientError.response.errors?.map(e => e.message).join('\n') || 'unknown error'; + const firstError = clientError.response.errors?.[0]; this.errorCode = firstError?.extensions?.webErrorCode; }