From d2e7578b2f32dadc82dc52ffb5e1bbd719b221ec Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 17 Mar 2021 09:43:22 +0100 Subject: [PATCH] better error message --- libs/remix-ui/file-explorer/src/lib/file-explorer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index 5d6bdada62..790add9b69 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -587,7 +587,9 @@ export const FileExplorer = (props: FileExplorerProps) => { fn: () => {} }) } else { - modal('Publish to gist Failed', data.message + ' ' + data.documentation_url + ' ' + JSON.stringify(data.errors, null, '\t'), { + const error = JSON.stringify(data.errors, null, '\t') || '' + const message = data.message === 'Not Found' ? data.message + '. Please make sure the API token has right to create a gist.' : data.message + modal('Publish to gist Failed', message + ' ' + data.documentation_url + ' ' + error, { label: 'Close', fn: async () => {} }, null)