nestjs-log-decorator 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/dist/index.cjs +16 -6
  2. package/package.json +1 -1
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestjs-log-decorator",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
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",