From ce60cfa30e2d2fc4c9251c3aad8909bede730e7f Mon Sep 17 00:00:00 2001 From: i5ting Date: Wed, 20 Oct 2021 19:21:58 +0800 Subject: [PATCH] fix: add type for error --- packages/core/src/mods/settingBar/components/json/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/mods/settingBar/components/json/index.tsx b/packages/core/src/mods/settingBar/components/json/index.tsx index d885e91..78a3f34 100644 --- a/packages/core/src/mods/settingBar/components/json/index.tsx +++ b/packages/core/src/mods/settingBar/components/json/index.tsx @@ -174,7 +174,7 @@ const EditModal: React.FC = (props) => { try { const codeObj = JSON.parse(json); formRef.current && formRef.current.setValue(codeObj); - } catch (error) { + } catch (error: any) { console.log( "can't parse code string to form schema, the error is:", error.message, @@ -213,7 +213,7 @@ const EditModal: React.FC = (props) => { JSON.parse(json); onOk(json); } - } catch (error) { + } catch (error: any) { message.error('内容必须是合法json'); console.log('save failed, the error is:', error.message); }