File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,14 @@ export async function push(requestBody: ReadonlyJSONValue) {
45
45
for ( const mutation of push . mutations ) {
46
46
const result = await processMutation ( push . clientGroupID , mutation , null ) ;
47
47
if ( result && 'error' in result ) {
48
- await processMutation ( push . clientGroupID , mutation , result . error ) ;
48
+ const result2 = await processMutation (
49
+ push . clientGroupID ,
50
+ mutation ,
51
+ result . error ,
52
+ ) ;
53
+ if ( result2 && 'error' in result2 ) {
54
+ throw result2 . error ;
55
+ }
49
56
}
50
57
}
51
58
@@ -57,8 +64,8 @@ export async function push(requestBody: ReadonlyJSONValue) {
57
64
async function processMutation (
58
65
clientGroupID : string ,
59
66
mutation : Mutation ,
60
- error : string | null ,
61
- ) : Promise < null | { error : string } > {
67
+ error : Error | null ,
68
+ ) : Promise < null | { error : Error } > {
62
69
return await transact ( async executor => {
63
70
console . log (
64
71
error === null ? 'Processing mutation' : 'Processing mutation error' ,
@@ -97,7 +104,7 @@ async function processMutation(
97
104
console . error (
98
105
`Error executing mutation: ${ JSON . stringify ( mutation ) } : ${ e } ` ,
99
106
) ;
100
- return { error : String ( e ) } ;
107
+ return { error : e as unknown as Error } ;
101
108
}
102
109
}
103
110
You can’t perform that action at this time.
0 commit comments