@@ -55,14 +55,14 @@ impl Error {
55
55
pub fn is_throttling_error ( & self ) -> bool {
56
56
match self {
57
57
Error :: Credentials ( _) => false ,
58
- Error :: GenerateCompletions ( e) => e. as_service_error ( ) . map_or ( false , |e| e. is_throttling_error ( ) ) ,
59
- Error :: GenerateRecommendations ( e) => e. as_service_error ( ) . map_or ( false , |e| e. is_throttling_error ( ) ) ,
60
- Error :: ListAvailableCustomizations ( e) => e. as_service_error ( ) . map_or ( false , |e| e. is_throttling_error ( ) ) ,
61
- Error :: ListAvailableServices ( e) => e. as_service_error ( ) . map_or ( false , |e| e. is_throttling_error ( ) ) ,
58
+ Error :: GenerateCompletions ( e) => e. as_service_error ( ) . is_some_and ( |e| e. is_throttling_error ( ) ) ,
59
+ Error :: GenerateRecommendations ( e) => e. as_service_error ( ) . is_some_and ( |e| e. is_throttling_error ( ) ) ,
60
+ Error :: ListAvailableCustomizations ( e) => e. as_service_error ( ) . is_some_and ( |e| e. is_throttling_error ( ) ) ,
61
+ Error :: ListAvailableServices ( e) => e. as_service_error ( ) . is_some_and ( |e| e. is_throttling_error ( ) ) ,
62
62
Error :: CodewhispererGenerateAssistantResponse ( e) => {
63
- e. as_service_error ( ) . map_or ( false , |e| e. is_throttling_error ( ) )
63
+ e. as_service_error ( ) . is_some_and ( |e| e. is_throttling_error ( ) )
64
64
} ,
65
- Error :: QDeveloperSendMessage ( e) => e. as_service_error ( ) . map_or ( false , |e| e. is_throttling_error ( ) ) ,
65
+ Error :: QDeveloperSendMessage ( e) => e. as_service_error ( ) . is_some_and ( |e| e. is_throttling_error ( ) ) ,
66
66
Error :: CodewhispererChatResponseStream ( _)
67
67
| Error :: QDeveloperChatResponseStream ( _)
68
68
| Error :: SmithyBuild ( _)
0 commit comments