File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ export interface HubInfo {
4242
4343export const getHubInfo = async ( gaiaHubUrl : string , fetchFn : FetchFn = createFetchFn ( ) ) => {
4444 const response = await fetchFn ( `${ gaiaHubUrl } /hub_info` ) ;
45+ if ( ! response . ok ) throw new Error ( 'Failed to fetch hub info' ) ;
46+
4547 const data : HubInfo = await response . json ( ) ;
4648 return data ;
4749} ;
Original file line number Diff line number Diff line change @@ -152,6 +152,10 @@ describe(makeAuthResponse.name, () => {
152152 fetchMock . mockImplementationOnce ( ( ) => Promise . reject ( new Error ( 'Request timeout' ) ) ) ,
153153 opts : { scopes : [ 'read_write' ] } ,
154154 } ,
155+ {
156+ mock : ( ) => fetchMock . mockResponseOnce ( 'Too Many Requests' , { status : 429 } ) ,
157+ opts : { } ,
158+ } ,
155159 ] ;
156160 test . each ( TEST_CASES ) ( makeAuthResponse . name , async ( { mock, opts } ) => {
157161 mock ( ) ;
You can’t perform that action at this time.
0 commit comments