Last active
September 11, 2017 05:07
-
-
Save frankshaka/5c2c5cc62332302e72f4aa57bae12883 to your computer and use it in GitHub Desktop.
Unmount paths even on error for koa-mount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58c58,68 | |
< await downstream(ctx, async () => { | |
--- | |
> try { | |
> await downstream(ctx, async () => { | |
> ctx.path = prev; | |
> try { | |
> await upstream(); | |
> } finally { | |
> ctx.path = newPath; | |
> } | |
> }); | |
> } finally { | |
> debug('leave %s -> %s', prev, ctx.path); | |
60,65c70 | |
< await upstream(); | |
< ctx.path = newPath; | |
< }); | |
< | |
< debug('leave %s -> %s', prev, ctx.path); | |
< ctx.path = prev; | |
--- | |
> } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment