@oclif/core 4.11.6 → 4.11.8

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/lib/command.js +6 -0
  2. package/package.json +1 -1
package/lib/command.js CHANGED
@@ -284,6 +284,12 @@ class Command {
284
284
  return results;
285
285
  }
286
286
  toErrorJson(err) {
287
+ if (err instanceof Error) {
288
+ // `Error.prototype.message`/`.name` are non-enumerable, so they are dropped
289
+ // by `JSON.stringify` in `logJson`. Surface them explicitly while preserving
290
+ // any enumerable own properties (e.g. a `CLIError`'s `oclif` metadata).
291
+ return { error: { ...err, message: err.message, name: err.name } };
292
+ }
287
293
  return { error: err };
288
294
  }
289
295
  toSuccessJson(result) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "4.11.6",
4
+ "version": "4.11.8",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {