diff --git a/src/class-wrapper.service.ts b/src/class-wrapper.service.ts index 9dcd4de..0244f29 100644 --- a/src/class-wrapper.service.ts +++ b/src/class-wrapper.service.ts @@ -56,9 +56,9 @@ export class ClassWrapperService { } try { - const res = fn.apply(this, args) - if (classWrapper.isPromise(res)) { - res + const fnRes = fn.apply(this, args) + if (classWrapper.isPromise(fnRes)) { + fnRes .then((result: any) => { logEnd(result) return result @@ -67,10 +67,10 @@ export class ClassWrapperService { logEnd(error, true) throw error }) - return res + return fnRes } - logEnd(res) - return res + logEnd(fnRes) + return fnRes } catch (error) { logEnd(error, true) throw error