File tree Expand file tree Collapse file tree 1 file changed +25
-11
lines changed
packages/node_modules/overmind/src Expand file tree Collapse file tree 1 file changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -581,18 +581,32 @@ export class Overmind<ThisConfig extends IConfiguration>
581581
582582 if ( isPromise ( result ) ) {
583583 this . eventHub . emit ( EventType . OPERATOR_ASYNC , execution )
584- result . then ( ( ) => {
585- execution . isRunning = false
586- if ( ! boundExecution ) {
587- mutationTree . dispose ( )
588- }
589- this . eventHub . emit ( EventType . OPERATOR_END , {
590- ...execution ,
591- isAsync : true ,
592- result : undefined ,
584+ result
585+ . then ( ( ) => {
586+ execution . isRunning = false
587+ if ( ! boundExecution ) {
588+ mutationTree . dispose ( )
589+ }
590+ this . eventHub . emit ( EventType . OPERATOR_END , {
591+ ...execution ,
592+ isAsync : true ,
593+ result : undefined ,
594+ } )
595+ this . eventHub . emit ( EventType . ACTION_END , execution )
596+ } )
597+ . catch ( ( error ) => {
598+ execution . isRunning = false
599+ if ( ! boundExecution ) {
600+ mutationTree . dispose ( )
601+ }
602+ this . eventHub . emit ( EventType . OPERATOR_END , {
603+ ...execution ,
604+ isAsync : true ,
605+ result : undefined ,
606+ error : error . message ,
607+ } )
608+ this . eventHub . emit ( EventType . ACTION_END , execution )
593609 } )
594- this . eventHub . emit ( EventType . ACTION_END , execution )
595- } )
596610 } else {
597611 execution . isRunning = false
598612 if ( ! boundExecution ) {
You can’t perform that action at this time.
0 commit comments