File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import software.amazon.awssdk.services.codewhispererruntime.model.GenerateComple
36
36
import software.amazon.awssdk.services.codewhispererruntime.model.GenerateCompletionsResponse
37
37
import software.amazon.awssdk.services.codewhispererruntime.model.ProgrammingLanguage
38
38
import software.amazon.awssdk.services.codewhispererruntime.model.RecommendationsWithReferencesPreference
39
+ import software.amazon.awssdk.services.codewhispererruntime.model.ResourceNotFoundException
39
40
import software.amazon.awssdk.services.codewhispererruntime.model.SupplementalContext
40
41
import software.amazon.awssdk.services.codewhispererruntime.model.ThrottlingException
41
42
import software.aws.toolkits.core.utils.debug
@@ -258,8 +259,8 @@ class CodeWhispererService {
258
259
val displayMessage: String
259
260
260
261
if (
261
- CodeWhispererConstants .Customization .customizationNotFoundExceptionPredicate (e) ||
262
- CodeWhispererConstants . Customization .invalidCustomizationExceptionPredicate(e)
262
+ CodeWhispererConstants .Customization .invalidCustomizationExceptionPredicate (e) ||
263
+ e is ResourceNotFoundException
263
264
) {
264
265
(e as CodeWhispererRuntimeException )
265
266
Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ object CodeWhispererConstants {
93
93
object Customization {
94
94
private const val noAccessToCustomizationMessage = " Your account is not authorized to use CodeWhisperer Enterprise."
95
95
private const val invalidCustomizationMessage = " You are not authorized to access"
96
- private const val customizationNotFoundMessage = " not found"
97
96
98
97
val noAccessToCustomizationExceptionPredicate: (e: Exception ) -> Boolean = { e ->
99
98
if (e !is CodeWhispererRuntimeException ) {
@@ -110,14 +109,6 @@ object CodeWhispererConstants {
110
109
e is AccessDeniedException && (e.message?.contains(invalidCustomizationMessage, ignoreCase = true ) ? : false )
111
110
}
112
111
}
113
-
114
- val customizationNotFoundExceptionPredicate: (e: Exception ) -> Boolean = { e ->
115
- if (e !is CodeWhispererRuntimeException ) {
116
- false
117
- } else {
118
- e is AccessDeniedException && (e.message?.contains(customizationNotFoundMessage, ignoreCase = true ) ? : false )
119
- }
120
- }
121
112
}
122
113
object CrossFile {
123
114
const val CHUNK_SIZE = 60
You can’t perform that action at this time.
0 commit comments