modality-kit 0.5.2 → 0.5.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.
Files changed (2) hide show
  1. package/dist/index.js +7 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -166,11 +166,11 @@ class ModalityLogger {
166
166
  const error = result.error;
167
167
  if (error instanceof Error) {
168
168
  delete result.error;
169
- const { message, stack } = error;
169
+ const { message, stack, ...restError } = error;
170
170
  if (stack) {
171
- if (Object.keys(result).length) {
171
+ if (Object.keys(restError).length) {
172
172
  console.error(`
173
- `, prefix, result, `
173
+ `, prefix, restError, `
174
174
  `, stack, `
175
175
  `);
176
176
  } else {
@@ -245,13 +245,12 @@ function withErrorHandling(fn, operation) {
245
245
  } catch (error) {
246
246
  if (error instanceof ErrorCode) {
247
247
  logger.error(`${operation || "Task operation"} failed: ${error.code}`, {
248
- message: error.message,
249
- code: error.code
248
+ code: error.code,
249
+ cause: error.cause,
250
+ stack: error.stack
250
251
  });
251
252
  } else if (error instanceof Error) {
252
- logger.error(`${operation || "Error"} failed`, {
253
- message: error.message
254
- });
253
+ logger.error(`${operation || "Error"} failed`, error);
255
254
  } else {
256
255
  logger.error(`${operation || "Exception"} unexpected error:`, error);
257
256
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.2",
2
+ "version": "0.5.3",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",