File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
packages/server/src/services Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -135,15 +135,25 @@ export const getTrustedOrigins = async () => {
135135 if ( trustedOriginsCache && now < trustedOriginsCache . expiresAt ) {
136136 return trustedOriginsCache . data ;
137137 }
138- const trustedOrigins = await runQuery ( ) ;
139- trustedOriginsCache = {
140- data : trustedOrigins ,
141- expiresAt : now + TRUSTED_ORIGINS_CACHE_TTL_MS ,
142- } ;
143- return trustedOrigins ;
138+ try {
139+ const trustedOrigins = await runQuery ( ) ;
140+ trustedOriginsCache = {
141+ data : trustedOrigins ,
142+ expiresAt : now + TRUSTED_ORIGINS_CACHE_TTL_MS ,
143+ } ;
144+ return trustedOrigins ;
145+ } catch ( error ) {
146+ console . error ( "Failed to fetch trusted origins:" , error ) ;
147+ return trustedOriginsCache ?. data ?? [ ] ;
148+ }
144149 }
145150
146- return runQuery ( ) ;
151+ try {
152+ return await runQuery ( ) ;
153+ } catch ( error ) {
154+ console . error ( "Failed to fetch trusted origins:" , error ) ;
155+ return [ ] ;
156+ }
147157} ;
148158
149159export const getTrustedProviders = async ( ) => {
You can’t perform that action at this time.
0 commit comments