nestjs-log-decorator 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -82,12 +82,22 @@ var LogWrapper = class {
82
82
  });
83
83
  }
84
84
  error(error) {
85
- this.logger.error({
86
- method: this.method,
87
- state: "error",
88
- args: this.args,
89
- error: prettifyAxiosError(error)
90
- });
85
+ try {
86
+ const pretifiedError = prettifyAxiosError(error);
87
+ this.logger.error({
88
+ method: this.method,
89
+ state: "error",
90
+ args: this.args,
91
+ error: pretifiedError
92
+ });
93
+ } catch {
94
+ this.logger.error({
95
+ method: this.method,
96
+ state: "error",
97
+ args: this.args,
98
+ error
99
+ });
100
+ }
91
101
  }
92
102
  };
93
103
  const isLoggable = (instance) => {
package/dist/index.d.cts CHANGED
@@ -250,4 +250,4 @@ declare const Log: <TArgs extends unknown[]>(options?: LogOptions<TArgs>) => Log
250
250
  */
251
251
  declare const NoLog: () => (_target: unknown, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
252
252
  //#endregion
253
- export { Log, type LogOptions, type Loggable, NoLog, isLoggable };
253
+ export { Log, type LogArgsFormatter, type LogOptions, type Loggable, NoLog, isLoggable };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestjs-log-decorator",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Decorator that removes try catch boilerplate logging from NestJS service methods",
5
5
  "author": "Vlad Goncharov <leovs010@gmail.com>",
6
6
  "license": "AGPL-3.0",