diff --git a/src/components/popup/Contents/LoadWeb/index.jsx b/src/components/popup/Contents/LoadWeb/index.jsx index 241146c4..6b2829c1 100644 --- a/src/components/popup/Contents/LoadWeb/index.jsx +++ b/src/components/popup/Contents/LoadWeb/index.jsx @@ -39,16 +39,20 @@ const Index = ({ type, loadWeb, HeaderButtonPortal }) => { setSheetIdValid(null); - const response = await fetch( - // eslint-disable-next-line max-len - `https://docs.google.com/spreadsheets/d/${sheetId}/gviz/tq?tqx=out:csv&sheet=${sheetName}` - ); - if (response.status !== 200) { + try { + const response = await fetch( + // eslint-disable-next-line max-len + `https://docs.google.com/spreadsheets/d/${sheetId}/gviz/tq?tqx=out:csv&sheet=${sheetName}` + ); + if (response.status !== 200) { + setSheetIdValid(SheetIdValidMsg[1]); + return; + } + const csv = await response.text(); + loadWeb(csv); + } catch (e) { setSheetIdValid(SheetIdValidMsg[1]); - return; } - const csv = await response.text(); - loadWeb(csv); }; return (