File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
packages/core/src/codewhispererChat/controllers/chat/messenger Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -742,6 +742,20 @@ export class Messenger {
742742 }
743743
744744 private showChatExceptionMessage ( e : ChatException , tabID : string , requestID : string | undefined ) {
745+ const title = 'An error occurred while processing your request.'
746+ // TODO: once the server sends the correct exception back, fix this
747+ if ( e . statusCode && e . statusCode === '500' ) {
748+ // Send throttling message
749+ this . dispatcher . sendErrorMessage (
750+ new ErrorMessage (
751+ title ,
752+ 'We are experiencing heavy traffic, please try again shortly.' . trimEnd ( ) . trimStart ( ) ,
753+ tabID
754+ )
755+ )
756+ return
757+ }
758+
745759 let message = 'This error is reported to the team automatically. We will attempt to fix it as soon as possible.'
746760 if ( e . errorMessage !== undefined ) {
747761 message += `\n\nDetails: ${ e . errorMessage } `
@@ -757,9 +771,7 @@ export class Messenger {
757771 message += `\n\nRequest ID: ${ requestID } `
758772 }
759773
760- this . dispatcher . sendErrorMessage (
761- new ErrorMessage ( 'An error occurred while processing your request.' , message . trimEnd ( ) . trimStart ( ) , tabID )
762- )
774+ this . dispatcher . sendErrorMessage ( new ErrorMessage ( title , message . trimEnd ( ) . trimStart ( ) , tabID ) )
763775 }
764776
765777 public sendOpenSettingsMessage ( triggerId : string , tabID : string ) {
You can’t perform that action at this time.
0 commit comments