Last active
December 22, 2016 17:02
-
-
Save ahlusar1989/f5e2bf72ded1f7c0ac20d045071d7c57 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
app.use(function* (next) { | |
this.accountService = {}; | |
for (const method in accountServiceClient) { | |
this.accountService[method] = function* () { | |
try { | |
return yield accountServiceClient[method].apply(null, arguments); | |
} | |
catch (e) { | |
requestLogger.error(e); | |
throw e; | |
} | |
}; | |
} | |
this.legacyApi = {}; | |
for (const method in apiLegacyClient) { | |
this.legacyApi[method] = function* () { | |
try { | |
return yield apiLegacyClient[method].apply(null, arguments); | |
} | |
catch (e) { | |
requestLogger.error(e); | |
throw e; | |
} | |
}; | |
} | |
yield next; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment