File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ class CallbackThrottler {
9090 private throttleTimeout : ReturnType < typeof setTimeout > | null = null ;
9191 private pendingCallback = false ;
9292
93- constructor ( private cb : ApiFetchCallback < AiAnswersResponse > ) { }
93+ constructor ( private readonly cb : ApiFetchCallback < AiAnswersResponse > ) { }
9494
9595 /**
9696 * Call callback immediately, bypassing throttling
@@ -379,7 +379,12 @@ const executeNonStreamingAiAnswers = (
379379 filter : settings ?. aiAnswersFilterObject
380380 } )
381381 } )
382- . then ( ( response ) => response . json ( ) )
382+ . then ( ( response ) => {
383+ if ( ! response . ok ) {
384+ throw new Error ( `HTTP error! status: ${ response . status } ` ) ;
385+ }
386+ return response . json ( ) ;
387+ } )
383388 . then ( ( data : ConversationsApiResponse ) => {
384389 if ( data . response ) {
385390 cb ( {
You can’t perform that action at this time.
0 commit comments