@@ -11,68 +11,68 @@ export class TestGenError extends ToolkitError {
11
11
constructor (
12
12
error : string ,
13
13
code : string ,
14
- public statusCode : string ,
14
+ public statusCode : number ,
15
15
public uiMessage : string
16
16
) {
17
17
super ( error , { code } )
18
18
}
19
19
}
20
20
export class ProjectZipError extends TestGenError {
21
21
constructor ( error : string ) {
22
- super ( error , 'ProjectZipError' , ' 400' , defaultTestGenErrorMessage )
22
+ super ( error , 'ProjectZipError' , 400 , defaultTestGenErrorMessage )
23
23
}
24
24
}
25
25
export class InvalidSourceZipError extends TestGenError {
26
26
constructor ( ) {
27
- super ( 'Failed to create valid source zip' , 'InvalidSourceZipError' , ' 400' , defaultTestGenErrorMessage )
27
+ super ( 'Failed to create valid source zip' , 'InvalidSourceZipError' , 400 , defaultTestGenErrorMessage )
28
28
}
29
29
}
30
30
export class CreateUploadUrlError extends TestGenError {
31
- constructor ( errorMessage : string , errorCode : string ) {
31
+ constructor ( errorMessage : string , errorCode : number ) {
32
32
super ( errorMessage , 'CreateUploadUrlError' , errorCode , technicalErrorCustomerFacingMessage )
33
33
}
34
34
}
35
35
export class UploadTestArtifactToS3Error extends TestGenError {
36
- constructor ( error : string , statusCode ?: string ) {
37
- super ( error , 'UploadTestArtifactToS3Error' , statusCode ?? ' 400' , technicalErrorCustomerFacingMessage )
36
+ constructor ( error : string , statusCode ?: number ) {
37
+ super ( error , 'UploadTestArtifactToS3Error' , statusCode ?? 400 , technicalErrorCustomerFacingMessage )
38
38
}
39
39
}
40
40
export class CreateTestJobError extends TestGenError {
41
- constructor ( error : string , code : string ) {
42
- super ( error , 'CreateTestJobError' , code , technicalErrorCustomerFacingMessage )
41
+ constructor ( error : string , statusCode : number ) {
42
+ super ( error , 'CreateTestJobError' , statusCode , technicalErrorCustomerFacingMessage )
43
43
}
44
44
}
45
45
export class TestGenTimedOutError extends TestGenError {
46
46
constructor ( ) {
47
47
super (
48
48
'Test generation failed. Amazon Q timed out.' ,
49
49
'TestGenTimedOutError' ,
50
- ' 500' ,
50
+ 500 ,
51
51
technicalErrorCustomerFacingMessage
52
52
)
53
53
}
54
54
}
55
55
export class TestGenStoppedError extends TestGenError {
56
56
constructor ( ) {
57
- super ( 'Unit test generation cancelled.' , 'TestGenCancelled' , ' 400' , 'Unit test generation cancelled.' )
57
+ super ( 'Unit test generation cancelled.' , 'TestGenCancelled' , 400 , 'Unit test generation cancelled.' )
58
58
}
59
59
}
60
60
export class TestGenFailedError extends TestGenError {
61
- constructor ( code : string , error ?: string ) {
61
+ constructor ( statusCode : number , error ?: string ) {
62
62
super (
63
63
error ?? 'Test generation failed' ,
64
64
'TestGenFailedError' ,
65
- code ,
65
+ statusCode ,
66
66
error ?? technicalErrorCustomerFacingMessage
67
67
)
68
68
}
69
69
}
70
70
export class ExportResultsArchiveError extends TestGenError {
71
- constructor ( error ?: string , statusCode ?: string ) {
71
+ constructor ( error ?: string , statusCode ?: number ) {
72
72
super (
73
73
error ?? 'Test generation failed' ,
74
74
'ExportResultsArchiveError' ,
75
- statusCode ?? ' 400' ,
75
+ statusCode ?? 400 ,
76
76
technicalErrorCustomerFacingMessage
77
77
)
78
78
}
0 commit comments