@emartech/json-logger 8.0.1 → 8.0.3

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.
@@ -123,6 +123,9 @@ class Logger {
123
123
  context: this.shortenData(error.data),
124
124
  stack_trace: this.shortenStackTrace(error.stack || ''),
125
125
  },
126
+ event: {
127
+ reason: error.message,
128
+ },
126
129
  };
127
130
  }
128
131
  getAxiosErrorDetails(error) {
@@ -131,8 +134,8 @@ class Logger {
131
134
  }
132
135
  if (Logger.config.outputFormat === 'legacy') {
133
136
  return {
134
- request_method: error.config.method,
135
- request_url: error.config.url,
137
+ request_method: error.config?.method,
138
+ request_url: error.config?.url,
136
139
  response_status: error.response ? error.response.status : undefined,
137
140
  response_status_text: error.response ? error.response.statusText : undefined,
138
141
  response_data: error.response ? this.shortenData(error.response.data) : undefined,
@@ -140,11 +143,11 @@ class Logger {
140
143
  }
141
144
  return {
142
145
  url: {
143
- full: error.config.url,
146
+ full: error.config?.url,
144
147
  },
145
148
  http: {
146
149
  request: {
147
- method: error.config.method,
150
+ method: error.config?.method,
148
151
  },
149
152
  response: {
150
153
  status_code: error.response ? error.response.status : undefined,
@@ -153,6 +156,9 @@ class Logger {
153
156
  },
154
157
  },
155
158
  },
159
+ error: {
160
+ code: error.code,
161
+ },
156
162
  };
157
163
  }
158
164
  }
package/package.json CHANGED
@@ -64,5 +64,5 @@
64
64
  "dependencies": {
65
65
  "lodash": "4.17.21"
66
66
  },
67
- "version": "8.0.1"
67
+ "version": "8.0.3"
68
68
  }