Skip to content

Commit bf5d0f2

Browse files
committed
Update error messages
1 parent c7e21c2 commit bf5d0f2

24 files changed

Lines changed: 39 additions & 39 deletions

File tree

lib/node_modules/@stdlib/_tools/github/dispatch-workflow/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function validate( opts, options ) {
5959
return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'protocol', opts.protocol ) );
6060
}
6161
if ( opts.protocol !== 'http' && opts.protocol !== 'https' ) {
62-
return new Error( format( 'invalid option. `%s` option must be either `http` or `https`. Option: `%s`.', 'protocol', opts.protocol ) );
62+
return new Error( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'protocol', [ 'http', 'https' ].join( '", "' ), opts.protocol ) );
6363
}
6464
}
6565
if ( hasOwnProp( options, 'hostname' ) ) {

lib/node_modules/@stdlib/_tools/github/get/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function validate( opts, options ) {
5959
return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'protocol', opts.protocol ) );
6060
}
6161
if ( opts.protocol !== 'http' && opts.protocol !== 'https' ) {
62-
return new Error( format( 'invalid option. `%s` option must be either `http` or `https`. Option: `%s`.', 'protocol', opts.protocol ) );
62+
return new Error( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'protocol', [ 'http', 'https' ].join( '", "' ), opts.protocol ) );
6363
}
6464
}
6565
if ( hasOwnProp( options, 'hostname' ) ) {

lib/node_modules/@stdlib/_tools/github/set-topics/lib/factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function factory( options, clbk ) {
8484
throw new TypeError( format( 'invalid argument. Repository slug must be a string. Value: `%s`.', slug ) );
8585
}
8686
if ( slug.split( '/' ).length !== 2 ) {
87-
throw new Error( format( 'invalid argument. Repository slug must consist of an `owner` and a `repository`; e.g., `stdlib-js/utils`. Value: `%s`.', slug ) );
87+
throw new Error( format( 'invalid argument. Repository slug must consist of an owner and a repository (e.g., "stdlib-js/utils"). Value: `%s`.', slug ) );
8888
}
8989
if ( !isStringArray( topics ) ) {
9090
throw new TypeError( format( 'invalid argument. Topics argument must be an array of strings. Value: `%s`.', topics ) );

lib/node_modules/@stdlib/_tools/github/star-repo/lib/factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function factory( options, clbk ) {
8181
throw new TypeError( format( 'invalid argument. Repository slug must be a string. Value: `%s`.', slug ) );
8282
}
8383
if ( slug.split( '/' ).length !== 2 ) {
84-
throw new Error( format( 'invalid argument. Repository slug must consist of an `owner` and a `repository`; e.g., `stdlib-js/utils`. Value: `%s`.', slug ) );
84+
throw new Error( format( 'invalid argument. Repository slug must consist of an owner and a repository (e.g., "stdlib-js/utils"). Value: `%s`.', slug ) );
8585
}
8686
query( slug, opts, done );
8787
/**

lib/node_modules/@stdlib/array/linspace/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function linspace( start, stop, len ) {
126126
}
127127
ctor = ctors( opts.dtype );
128128
if ( ctor === null ) {
129-
throw new TypeError( format( 'invalid argument. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.', 'dtype', opts.dtype ) );
129+
throw new TypeError( format( 'invalid option. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.', 'dtype', opts.dtype ) );
130130
}
131131
out = new ctor( len );
132132
if ( opts.dtype === 'complex64' ) {

lib/node_modules/@stdlib/array/pool/lib/factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ function factory( options ) {
329329
if ( isTypedArrayLike( buf ) && buf.buffer ) {
330330
buf = buf.buffer;
331331
} else if ( !isArrayBuffer( buf ) ) {
332-
throw new TypeError( format( 'invalid argument. Must provide a typed array or typed array buffer. Value: `%s`.', buf ) );
332+
throw new TypeError( format( 'invalid argument. Must provide a typed array or ArrayBuffer. Value: `%s`.', buf ) );
333333
}
334334
if ( buf.byteLength > 0 ) {
335335
n = floor( log2( buf.byteLength ) );

lib/node_modules/@stdlib/assert/is-between-array/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ function isBetweenArray( value, a, b, left, right ) {
6868
var i;
6969
if ( arguments.length > 3 ) {
7070
if ( left !== 'closed' && left !== 'open' ) {
71-
throw new TypeError( format( 'invalid argument. `left` must be one of the following: "closed" or "open". Value: `%s`.', left ) );
71+
throw new TypeError( format( 'invalid argument. Fourth argument must be one of the following: "%s". Value: `%s`.', [ 'closed', 'open' ].join( '", "' ), left ) );
7272
}
7373
if ( right !== 'closed' && right !== 'open' ) {
74-
throw new TypeError( format( 'invalid argument. `right` must be one of the following: "closed" or "open". Value: `%s`.', right ) );
74+
throw new TypeError( format( 'invalid argument. Fifth argument must be one of the following: "%s". Value: `%s`.', [ 'closed', 'open' ].join( '", "' ), right ) );
7575
}
7676
}
7777
if ( !isCollection( value ) ) {

lib/node_modules/@stdlib/assert/is-between/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ var format = require( '@stdlib/string/format' );
6464
function isBetween( value, a, b, left, right ) {
6565
if ( arguments.length > 3 ) {
6666
if ( left !== 'closed' && left !== 'open' ) {
67-
throw new TypeError( format( 'invalid argument. `left` must be one of the following: "closed" or "open". Value: `%s`.', left ) );
67+
throw new TypeError( format( 'invalid argument. Fourth argument must be one of the following: "%s". Value: `%s`.', [ 'closed', 'open' ].join( '", "' ), left ) );
6868
}
6969
if ( right !== 'closed' && right !== 'open' ) {
70-
throw new TypeError( format( 'invalid argument. `right` must be one of the following: "closed" or "open". Value: `%s`.', right ) );
70+
throw new TypeError( format( 'invalid argument. Fifth argument must be one of the following: "%s". Value: `%s`.', [ 'closed', 'open' ].join( '", "' ), right ) );
7171
}
7272
}
7373
if ( left === 'closed' || left === void 0 ) {

lib/node_modules/@stdlib/ml/incr/binary-classification/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function incrBinaryClassification( N, options ) {
191191
if ( arguments.length > 1 ) {
192192
if ( type === 'probability' ) {
193193
if ( opts.loss !== 'log' && opts.loss !== 'modifiedHuber' ) {
194-
throw new Error( format( 'invalid argument. Second argument is incompatible with model loss function. Probability predictions are only supported when the loss function is either `log` or `modifiedHuber`. Model loss function: `%s`.', opts.loss ) );
194+
throw new Error( format( 'invalid argument. Second argument is incompatible with model loss function. Probability predictions are only supported when the loss function is one of the following: "%s". Model loss function: `%s`.', [ 'log', 'modifiedHuber' ].join( '", "' ), opts.loss ) );
195195
}
196196
} else if ( type !== 'label' && type !== 'linear' ) {
197197
throw new TypeError( format( 'invalid argument. Second argument must be a string value equal to either "label", "probability", or "linear". Value: `%s`.', type ) );

lib/node_modules/@stdlib/ndarray/ctor/lib/main.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,39 +112,39 @@ function ndarray( dtype, buffer, shape, strides, offset, order, options ) {
112112
return new ndarray( dtype, buffer, shape, strides, offset, order, options ); // eslint-disable-line max-len
113113
}
114114
if ( !isDataType( dtype ) ) {
115-
throw new TypeError( format( 'invalid argument. `dtype` argument must be a supported ndarray data type. Value: `%s`.', dtype ) );
115+
throw new TypeError( format( 'invalid argument. First argument must be a supported ndarray data type. Value: `%s`.', dtype ) );
116116
}
117117
if ( !isCollection( buffer ) ) {
118-
throw new TypeError( format( 'invalid argument. `buffer` argument must be an array-like object, typed-array-like, or a Buffer. Value: `%s`.', buffer ) );
118+
throw new TypeError( format( 'invalid argument. Second argument must be an array-like object, typed-array-like, or a Buffer. Value: `%s`.', buffer ) );
119119
} else if ( buffer.get && buffer.set && ( !isFunction( buffer.get ) || !isFunction( buffer.set ) ) ) { // eslint-disable-line max-len
120-
throw new TypeError( format( 'invalid argument. `buffer` argument `get` and `set` properties must be functions. Value: `%s`.', buffer ) );
120+
throw new TypeError( format( 'invalid argument. Second argument `get` and `set` properties must be functions. Value: `%s`.', buffer ) );
121121
}
122122
if ( !isNonNegativeIntegerArray( shape ) ) {
123123
if ( !isCollection( shape) || shape.length > 0 ) {
124-
throw new TypeError( format( 'invalid argument. `shape` argument must be an array-like object containing nonnegative integers. Value: `%s`.', shape ) );
124+
throw new TypeError( format( 'invalid argument. Third argument must be an array-like object containing nonnegative integers. Value: `%s`.', shape ) );
125125
}
126126
}
127127
ndims = shape.length;
128128
if ( ndims > MAX_DIMS ) {
129129
throw new RangeError( format( 'invalid argument. Number of dimensions must not exceed %u due to stack limits. Value: `%u`.', MAX_DIMS, ndims ) );
130130
}
131131
if ( !isIntegerArray( strides ) ) {
132-
throw new TypeError( format( 'invalid argument. `strides` argument must be an array-like object containing integers. Value: `%s`.', strides ) );
132+
throw new TypeError( format( 'invalid argument. Fourth argument must be an array-like object containing integers. Value: `%s`.', strides ) );
133133
}
134134
if ( ndims > 0 ) {
135135
if ( strides.length !== ndims ) {
136-
throw new RangeError( format( 'invalid argument. `strides` argument length must match the number of dimensions. Expected number of dimensions: `%u`. Strides length: `%u`.', ndims, strides.length ) );
136+
throw new RangeError( format( 'invalid argument. Fourth argument length must match the number of dimensions. Expected number of dimensions: `%u`. Strides length: `%u`.', ndims, strides.length ) );
137137
}
138138
} else if ( strides.length !== 1 ) {
139-
throw new RangeError( 'invalid argument. `strides` length must be equal to 1 when creating a zero-dimensional ndarray.' );
139+
throw new RangeError( 'invalid argument. Fourth argument length must be equal to 1 when creating a zero-dimensional ndarray.' );
140140
} else if ( strides[ 0 ] !== 0 ) {
141-
throw new RangeError( format( 'invalid argument. `strides` argument must contain a single element equal to `0`. Value: `%d`.', strides[ 0 ] ) );
141+
throw new RangeError( format( 'invalid argument. Fourth argument must contain a single element equal to `0`. Value: `%d`.', strides[ 0 ] ) );
142142
}
143143
if ( !isNonNegativeInteger( offset ) ) {
144-
throw new TypeError( format( 'invalid argument. `offset` argument must be a nonnegative integer. Value: `%s`.', offset ) );
144+
throw new TypeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%s`.', offset ) );
145145
}
146146
if ( !isOrder( order ) ) {
147-
throw new TypeError( format( 'invalid argument. `order` argument must be a supported order. Value: `%s`.', order ) );
147+
throw new TypeError( format( 'invalid argument. Sixth argument must be a supported order. Value: `%s`.', order ) );
148148
}
149149
if ( ndims > 0 && !isBufferLengthCompatible( buffer.length, shape, strides, offset ) && numel( shape ) > 0 ) { // eslint-disable-line max-len
150150
throw new Error( 'invalid arguments. The input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.' );

0 commit comments

Comments
 (0)