@emartech/json-logger 8.0.2 → 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.
@@ -134,8 +134,8 @@ class Logger {
134
134
  }
135
135
  if (Logger.config.outputFormat === 'legacy') {
136
136
  return {
137
- request_method: error.config.method,
138
- request_url: error.config.url,
137
+ request_method: error.config?.method,
138
+ request_url: error.config?.url,
139
139
  response_status: error.response ? error.response.status : undefined,
140
140
  response_status_text: error.response ? error.response.statusText : undefined,
141
141
  response_data: error.response ? this.shortenData(error.response.data) : undefined,
@@ -143,11 +143,11 @@ class Logger {
143
143
  }
144
144
  return {
145
145
  url: {
146
- full: error.config.url,
146
+ full: error.config?.url,
147
147
  },
148
148
  http: {
149
149
  request: {
150
- method: error.config.method,
150
+ method: error.config?.method,
151
151
  },
152
152
  response: {
153
153
  status_code: error.response ? error.response.status : undefined,
@@ -156,6 +156,9 @@ class Logger {
156
156
  },
157
157
  },
158
158
  },
159
+ error: {
160
+ code: error.code,
161
+ },
159
162
  };
160
163
  }
161
164
  }
package/package.json CHANGED
@@ -64,5 +64,5 @@
64
64
  "dependencies": {
65
65
  "lodash": "4.17.21"
66
66
  },
67
- "version": "8.0.2"
67
+ "version": "8.0.3"
68
68
  }