@caweb/cli 1.12.2 → 1.12.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.
@@ -1,5 +1,4 @@
1
1
  import { parse } from 'node-html-parser';
2
- import { writeLine } from '../../lib/index.js';
3
2
 
4
3
  /**
5
4
  * Validates the HTML of a page.
package/lib/spinner.js CHANGED
@@ -70,25 +70,25 @@ const withSpinner =
70
70
  }
71
71
 
72
72
  spinner.fail( msg )
73
- process.exit( 1 );
74
-
75
73
 
76
-
77
- }else if( error ){
78
- // Error is an unknown error. That means there was a bug in our code.
74
+ // An Error was thrown.
75
+ }else if( error && 'object' === typeof error ){
76
+ // If the error has a message, use that.
79
77
  spinner.fail(
80
78
  typeof error === 'string' ? error : error.message
81
79
  );
82
- // Disable reason: Using console.error() means we get a stack trace.
83
- console.error( error );
84
- process.exit( 1 );
85
80
 
81
+ // Error is an unknown error. That means there was a bug in our code.
86
82
  }else{
87
83
  spinner.fail( 'An unknown error occurred.' );
88
- process.exit( 1 );
84
+
85
+ // Using console.error() means we get a stack trace.
86
+ console.error( error );
89
87
 
90
88
  }
91
89
 
90
+ process.exit( 1 );
91
+
92
92
  }
93
93
  );
94
94
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/cli",
3
- "version": "1.12.2",
3
+ "version": "1.12.3",
4
4
  "description": "CAWebPublishing Command Line Interface.",
5
5
  "exports": "./lib/env.js",
6
6
  "type": "module",