@@ -5,32 +5,34 @@ public class BlockResult
55 public string ? Key { get ; }
66 public object ? Data { get ; }
77 public string ? Message { get ; }
8+ public Exception ? Exception { get ; set ; }
89 public BlockResultType ResultType { get ; }
910
10- internal BlockResult ( object ? data , string ? key , string ? message , BlockResultType resultType )
11+ internal BlockResult ( object ? data , string ? key , string ? message , BlockResultType resultType , Exception ? exception )
1112 {
1213 Data = data ;
1314 Key = key ;
1415 Message = message ;
1516 ResultType = resultType ;
17+ Exception = exception ;
1618 }
1719
18- public static BlockResult Completed ( string ? message = null ) => new ( default , null , message , BlockResultType . Completed ) ;
19- public static BlockResult Error ( string ? message = null ) => new ( default , null , message , BlockResultType . Error ) ;
20- public static BlockResult < T > Exit < T > ( T ? data = default ) => new ( data , null , null , BlockResultType . Exit ) ;
21- public static BlockResult < T > Forward < T > ( T ? data = default ) => new ( data , null , null , BlockResultType . Forward ) ;
22- public static BlockResult < T > Execute < T > ( T ? data = default ) => new ( data , null , null , BlockResultType . Execute ) ;
20+ public static BlockResult Completed ( string ? message = null ) => new ( default , null , message , BlockResultType . Completed , null ) ;
21+ public static BlockResult Error ( string ? message = null , Exception ? exception = null ) => new ( default , null , message , BlockResultType . Error , exception ) ;
22+ public static BlockResult < T > Exit < T > ( T ? data = default ) => new ( data , null , null , BlockResultType . Exit , null ) ;
23+ public static BlockResult < T > Forward < T > ( T ? data = default ) => new ( data , null , null , BlockResultType . Forward , null ) ;
24+ public static BlockResult < T > Execute < T > ( T ? data = default ) => new ( data , null , null , BlockResultType . Execute , null ) ;
2325}
2426
2527public class BlockResult < T > : BlockResult
2628{
2729 public new T ? Data { get ; }
2830
29- internal BlockResult ( T ? data , string ? key , string ? message , BlockResultType resultType ) : base ( data , key , message , resultType ) => Data = data ;
31+ internal BlockResult ( T ? data , string ? key , string ? message , BlockResultType resultType , Exception ? exception ) : base ( data , key , message , resultType , exception ) => Data = data ;
3032
31- public static new BlockResult < T > Completed ( string ? message = null ) => new ( default , null , message , BlockResultType . Completed ) ;
32- public static BlockResult < T > Skip ( ) => new ( default , null , null , BlockResultType . Skip ) ;
33- public static new BlockResult < T > Error ( string ? message = null ) => new ( default , null , message , BlockResultType . Error ) ;
34- public static BlockResult < T > BackToCheckpoint ( string ? key = null ) => new ( default , key , null , BlockResultType . BackToCheckpoint ) ;
35- public static BlockResult < T > BackToExit ( string ? key = null ) => new ( default , key , null , BlockResultType . BackToExit ) ;
33+ public static new BlockResult < T > Completed ( string ? message = null ) => new ( default , null , message , BlockResultType . Completed , null ) ;
34+ public static BlockResult < T > Skip ( ) => new ( default , null , null , BlockResultType . Skip , null ) ;
35+ public static new BlockResult < T > Error ( string ? message = null , Exception ? exception = null ) => new ( default , null , message , BlockResultType . Error , exception ) ;
36+ public static BlockResult < T > BackToCheckpoint ( string ? key = null ) => new ( default , key , null , BlockResultType . BackToCheckpoint , null ) ;
37+ public static BlockResult < T > BackToExit ( string ? key = null ) => new ( default , key , null , BlockResultType . BackToExit , null ) ;
3638}
0 commit comments