File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ module.exports = function (eleventyConfig) {
9292 // currently this only returns an HTML widget that
9393 // shows the aqi for Mumbai, though this could easily be changed
9494 eleventyConfig . addAsyncShortcode ( "aqi" , async ( location ) => {
95+ const fallback = `<table align=center><tr><td>⚠️ failed to retrieve AQI reading for ${ location . toUpperCase ( ) } ⚠️</td></tr></table>` ;
96+ return fallback ;
9597 console . log ( `[cyberb] pulling AQI data for ${ location } ` ) ;
9698 const { statusCode, body } = await request (
9799 "https://airnowgovapi.com/reportingarea/get" ,
@@ -104,7 +106,6 @@ module.exports = function (eleventyConfig) {
104106 } ,
105107 ) ;
106108
107- const fallback = `<table align=center><tr><td>⚠️ failed to retrieve AQI reading for ${ location . toUpperCase ( ) } ⚠️</td></tr></table>` ;
108109 if ( statusCode !== 200 ) {
109110 console . log ( `[cyberb] AQI data call failed with error ${ statusCode } ` ) ;
110111 return fallback ;
You can’t perform that action at this time.
0 commit comments