@gricha/perry 0.1.0 → 0.1.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.js +15 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -452,6 +452,21 @@ function handleError(err) {
452
452
  else if (err instanceof Error) {
453
453
  console.error(`Error: ${err.message}`);
454
454
  }
455
+ else if (err && typeof err === 'object') {
456
+ const errObj = err;
457
+ if ('message' in errObj && typeof errObj.message === 'string') {
458
+ console.error(`Error: ${errObj.message}`);
459
+ }
460
+ else if ('code' in errObj) {
461
+ console.error(`Error: ${String(errObj.code)}`);
462
+ }
463
+ else {
464
+ console.error(`Error: ${JSON.stringify(err)}`);
465
+ }
466
+ }
467
+ else if (err !== undefined && err !== null) {
468
+ console.error(`Error: ${String(err)}`);
469
+ }
455
470
  else {
456
471
  console.error('An unknown error occurred');
457
472
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gricha/perry",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Self-contained CLI for spinning up Docker-in-Docker development environments with SSH and proxy helpers.",
5
5
  "type": "module",
6
6
  "bin": {