From 758b156db2bed3a2cece3879cfd8639437ea5551 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 15 Mar 2022 16:23:41 -0300 Subject: [PATCH] Add debug info for map role loading --- packages/webapp/src/components/editor-page/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index bef42b0b..3ff8da81 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -36,7 +36,11 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { const fetchResult = fetchMapById(mapId); if (!fetchResult.isLoading) { if (fetchResult.error) { - throw new Error(`User coild not be loaded: ${JSON.stringify(fetchResult.error)}`); + throw new Error(`Map info could not be loaded: ${JSON.stringify(fetchResult.error)}`); + } + + if (!fetchResult.map) { + throw new Error(`Map info could not be loaded. Info not present: ${JSON.stringify(fetchResult)}`); } result = fetchResult.map.role === 'owner' ? 'edition-owner' : 'edition-editor'; }