Skip to content

Commit cb4ee92

Browse files
committed
docs: update JSDoc examples to use console.error instead of throwing errors
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent da04e3f commit cb4ee92

File tree

11 files changed

+21
-19
lines changed

11 files changed

+21
-19
lines changed

lib/node_modules/@stdlib/_tools/browserify/file-list/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*
3434
* function clbk( error ) {
3535
* if ( error ) {
36-
* throw error;
36+
* console.error( error.message );
3737
* }
3838
* }
3939
*
@@ -46,7 +46,7 @@
4646
*
4747
* function clbk( error, bundle ) {
4848
* if ( error ) {
49-
* throw error;
49+
* return console.error( error.message );
5050
* }
5151
* console.log( bundle.toString() );
5252
* }

lib/node_modules/@stdlib/_tools/browserify/file-list/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var debug = logger( 'browserify:file-list' );
5353
*
5454
* function clbk( error, bundle ) {
5555
* if ( error ) {
56-
* throw error;
56+
* return console.error( error.message );
5757
* }
5858
* console.log( bundle.toString() );
5959
* }

lib/node_modules/@stdlib/_tools/licenses/insert-header-file-list/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* function done( error ) {
3838
* if ( error ) {
39-
* throw error;
39+
* console.error( error.message );
4040
* }
4141
* }
4242
*
@@ -51,7 +51,7 @@
5151
*
5252
* var err = insertHeader.sync( files, header );
5353
* if ( err instanceof Error ) {
54-
* throw err;
54+
* console.error( err.message );
5555
* }
5656
*/
5757

lib/node_modules/@stdlib/_tools/licenses/insert-header-file-list/lib/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var FOPTS = {
6767
*
6868
* var err = insertHeader( files, header );
6969
* if ( err instanceof Error ) {
70-
* throw err;
70+
* console.error( err.message );
7171
* }
7272
*/
7373
function insertHeader( files, header ) {

lib/node_modules/@stdlib/_tools/licenses/remove-header-file-list/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* function done( error ) {
3838
* if ( error ) {
39-
* throw error;
39+
* console.error( error.message );
4040
* }
4141
* }
4242
*
@@ -51,7 +51,7 @@
5151
*
5252
* var err = removeHeader.sync( files, header );
5353
* if ( err instanceof Error ) {
54-
* throw err;
54+
* console.error( err.message );
5555
* }
5656
*/
5757

lib/node_modules/@stdlib/_tools/licenses/remove-header-file-list/lib/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var FOPTS = {
6868
*
6969
* var err = removeHeader( files, header );
7070
* if ( err instanceof Error ) {
71-
* throw err;
71+
* console.error( err.message );
7272
* }
7373
*/
7474
function removeHeader( files, header ) {

lib/node_modules/@stdlib/_tools/licenses/update-header-file-list/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* function done( error ) {
4040
* if ( error ) {
41-
* throw error;
41+
* console.error( error.message );
4242
* }
4343
* }
4444
*
@@ -55,7 +55,7 @@
5555
*
5656
* var err = updateHeader.sync( files, old, header );
5757
* if ( err instanceof Error ) {
58-
* throw err;
58+
* console.error( err.message );
5959
* }
6060
*/
6161

lib/node_modules/@stdlib/_tools/licenses/update-header-file-list/lib/sync.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var FOPTS = {
7272
*
7373
* var err = updateHeader( files, old, header );
7474
* if ( err instanceof Error ) {
75-
* throw err;
75+
* console.error( err.message );
7676
* }
7777
*/
7878
function updateHeader( files, old, header ) {
@@ -97,7 +97,7 @@ function updateHeader( files, old, header ) {
9797
for ( i = 0; i < keys.length; i++ ) {
9898
v = old[ keys[i] ];
9999
if ( !isString( v ) && !isRegExp( v ) ) {
100-
throw new TypeError( format( 'invalid argument. A header object must map each filename extension to a license header string or regular expression. `%s: %s`. Value: `%s`.', keys[i], v, JSON.stringify( old ) ) );
100+
throw new TypeError( format( 'invalid argument. A header object must map each filename extension to a license header string or regular expression. `%s: %s`. Value: `%s`.', keys[i], v, JSON.stringify( old ) ) );
101101
}
102102
}
103103
} else if ( !isString( old ) && !isRegExp( old ) ) {

lib/node_modules/@stdlib/_tools/lint/license-header-file-list/lib/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* function onLint( error, errs ) {
3838
* if ( error ) {
39-
* throw error;
39+
* return console.error( error.message );
4040
* }
4141
* console.error( errs );
4242
* }
@@ -52,9 +52,10 @@
5252
*
5353
* var errs = lint.sync( files, header );
5454
* if ( errs instanceof Error ) {
55-
* throw errs;
55+
* console.error( errs.message );
56+
* } else {
57+
* console.error( errs );
5658
* }
57-
* console.error( errs );
5859
*/
5960

6061
// MODULES //

lib/node_modules/@stdlib/_tools/lint/license-header-file-list/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ var SPDX = 'Apache-2.0';
7777
*
7878
* function onLint( error, errs ) {
7979
* if ( error ) {
80-
* throw error;
80+
* return console.error( error.message );
8181
* }
8282
* console.error( errs );
8383
* }

0 commit comments

Comments
 (0)