File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,12 @@ export async function GET() {
1414 headers : {
1515 "Content-Type" : "application/json" ,
1616 } ,
17- } )
18- . then ( ( res ) => res . json ( ) as Promise < ApiResponseType > )
19- . catch ( ( error ) => {
20- console . error ( error ) ;
21- return { data : { } as ApiResponseType [ "data" ] } ;
22- } ) ,
17+ } ) . then ( ( res ) => res . json ( ) as Promise < ApiResponseType > ) ,
2318 fetch ( "https://api.thirdweb.com/v1/chains" , {
2419 headers : {
2520 "Content-Type" : "application/json" ,
2621 } ,
27- } )
28- . then ( ( res ) => res . json ( ) as Promise < { data : ChainMetadata [ ] } > )
29- . catch ( ( error ) => {
30- console . error ( error ) ;
31- return { data : [ ] as ChainMetadata [ ] } ;
32- } ) ,
22+ } ) . then ( ( res ) => res . json ( ) as Promise < { data : ChainMetadata [ ] } > ) ,
3323 ] ) ;
3424
3525 const aaChains = Object . entries ( chainsWithServices . data )
Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ async function getChains(): Promise<ChainMetadata[]> {
77 try {
88 const chains = await fetch ( `${ getBaseUrl ( ) } /api/aa-chains` ) ;
99 if ( ! chains . ok ) {
10+ console . error ( "Failed to fetch chains" , chains . statusText ) ;
1011 return [ ] ;
1112 }
1213 const result = ( await chains . json ( ) ) as { data : ChainMetadata [ ] } ;
1314 return result . data ;
1415 } catch ( error ) {
15- console . error ( error ) ;
16+ console . error ( "Failed to fetch chains" , error ) ;
1617 return [ ] ;
1718 }
1819}
You can’t perform that action at this time.
0 commit comments