From 07bd23128525fe0239e2ab14bfd9063fb0b76bf5 Mon Sep 17 00:00:00 2001 From: Melissa Garcia Date: Fri, 21 Jun 2024 08:05:26 -0700 Subject: [PATCH] rc4 - catch exception --- packages/gatsby-theme-aio/package.json | 2 +- .../src/components/RedoclyAPIBlock/index.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/gatsby-theme-aio/package.json b/packages/gatsby-theme-aio/package.json index d1a68df243..da7ad6fba8 100644 --- a/packages/gatsby-theme-aio/package.json +++ b/packages/gatsby-theme-aio/package.json @@ -1,6 +1,6 @@ { "name": "@adobe/gatsby-theme-aio", - "version": "4.11.16-rc3", + "version": "4.11.16-rc4", "description": "The Adobe I/O theme for building markdown powered sites", "main": "index.js", "license": "Apache-2.0", diff --git a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js index d7dbb989a3..ed09ed6b27 100644 --- a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js +++ b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js @@ -40,16 +40,20 @@ const RedoclyAPIBlock = ({ } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import#importing_on-demand_in_response_to_user_action let module; console.log('~~ 1'); if(requestInterceptorSrc) { console.log('~~ 2'); - import(requestInterceptorSrc).then((mod) => { - module = mod; - console.log('~~ 3', mod, module); - }); + import(requestInterceptorSrc) + .then((mod) => { + console.log('~~ 3', mod); + }) + .catch((err) => { + console.log('~~ 4', err.message); + }); } - console.log('~~ 4'); + console.log('~~ 5'); useEffect(() => { let script = document.createElement('script')