File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
packages/@aws-cdk/aws-stepfunctions Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ export interface FailProps {
15
15
16
16
/**
17
17
* Error code used to represent this failure
18
+ *
19
+ * @default No error code
18
20
*/
19
- error : string ;
21
+ error ? : string ;
20
22
21
23
/**
22
24
* A description for the cause of the failure
@@ -34,10 +36,10 @@ export interface FailProps {
34
36
export class Fail extends State {
35
37
public readonly endStates : INextable [ ] = [ ] ;
36
38
37
- private readonly error : string ;
39
+ private readonly error ? : string ;
38
40
private readonly cause ?: string ;
39
41
40
- constructor ( scope : cdk . Construct , id : string , props : FailProps ) {
42
+ constructor ( scope : cdk . Construct , id : string , props : FailProps = { } ) {
41
43
super ( scope , id , props ) ;
42
44
43
45
this . error = props . error ;
@@ -55,4 +57,4 @@ export class Fail extends State {
55
57
Cause : this . cause ,
56
58
} ;
57
59
}
58
- }
60
+ }
Original file line number Diff line number Diff line change
1
+ import cdk = require( '@aws-cdk/cdk' ) ;
2
+ import { Test } from 'nodeunit' ;
3
+ import stepfunctions = require( '../lib' ) ;
4
+
5
+ export = {
6
+ 'Props are optional' ( test : Test ) {
7
+ const stack = new cdk . Stack ( ) ;
8
+
9
+ new stepfunctions . Fail ( stack , 'Fail' ) ;
10
+
11
+ test . done ( ) ;
12
+ }
13
+ } ;
You can’t perform that action at this time.
0 commit comments