File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,18 @@ class HFInferenceProviderClient {
5454
5555 if ( ! response . ok ) {
5656 const errorText = await response . text ( ) ;
57- throw new Error ( `Request failed: ${ response . status } ${ response . statusText } - ${ errorText } ` ) ;
57+ const error = new Error ( `Request failed: ${ response . status } ${ response . statusText } - ${ errorText } ` ) ;
58+ if ( response . status !== 409 ) {
59+ console . error ( 'Request error:' , error ) ;
60+ }
61+ throw error ;
5862 }
5963
6064 return await response . json ( ) ;
6165 } catch ( error ) {
62- console . error ( 'Request error:' , error ) ;
66+ if ( error instanceof Error && ! error . message . includes ( '409 Conflict' ) ) {
67+ console . error ( 'Request error:' , error ) ;
68+ }
6369 throw error ;
6470 }
6571 }
Original file line number Diff line number Diff line change @@ -72,7 +72,15 @@ if (inferenceTags.length > 0) {
7272 console . log ( "\n\nAdding tag mappings:" ) ;
7373 for ( const tag of inferenceTags ) {
7474 console . log ( `${ tag . tags . join ( ', ' ) } - ${ tag . status ?? 'live' } ` ) ;
75- await hf . registerMappingItem ( tag ) ;
75+ try {
76+ await hf . registerMappingItem ( tag ) ;
77+ } catch ( error ) {
78+ if ( error instanceof Error && error . message . includes ( '409 Conflict' ) ) {
79+ console . log ( `Skipping existing mapping for tags: ${ tag . tags . join ( ', ' ) } ` ) ;
80+ continue ;
81+ }
82+ throw error ;
83+ }
7684 }
7785} else {
7886 console . log ( "\n\nNo tag mappings to add." ) ;
You can’t perform that action at this time.
0 commit comments