Skip to content

Commit

Permalink
fix(cache): change add error log
Browse files Browse the repository at this point in the history
  • Loading branch information
isuvorov committed Dec 21, 2023
1 parent 2ef4e06 commit c13b1ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/cache/src/Cache.decorator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// TODO: @ga2mer: прокинуть везде типы
// @ts-nocheck

import { createLogger } from '@lsk4/log';
import { CACHE_MANAGER } from '@nestjs/cache-manager';
import { Inject, Req } from '@nestjs/common';
import { isNil } from '@nestjs/common/utils/shared.utils';
Expand Down Expand Up @@ -35,6 +36,8 @@ function transform(obj: any) {
return transformedObj;
}

const log = createLogger('cache');

export function Cache(params: Params) {
const injector = Inject(CACHE_MANAGER);
return (
Expand Down Expand Up @@ -91,7 +94,7 @@ export function Cache(params: Params) {
this.cacheManager.set(...cacheArgs);
return result;
} catch (err) {
console.error(err);
log.error(err);
return originalMethod(args);
}
};
Expand Down

0 comments on commit c13b1ae

Please sign in to comment.