Skip to content

Commit 7698384

Browse files
committed
Update error messages
1 parent 260f6ec commit 7698384

File tree

25 files changed

+29
-29
lines changed

25 files changed

+29
-29
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
459459
// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...
460460
if ( flg ) {
461461
if ( !isEven( len ) ) {
462-
throw new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );
462+
throw new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );
463463
}
464464
out = new this( len/2 );
465465
buf = out._buffer; // eslint-disable-line no-underscore-dangle

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ setReadOnly( Model.prototype, '_regularize', function regularize( eta ) {
449449
setReadOnly( Model.prototype, '_scale', function scale( factor ) {
450450
var s;
451451
if ( factor <= 0.0 ) {
452-
throw new RangeError( format( 'invalid argument. Attempting to scale a weight vector by a nonpositive value. This is likely due to too large a value of `eta*lambda`. Value: `%f`.', factor ) );
452+
throw new RangeError( format( 'invalid argument. Attempting to scale a weight vector by a nonpositive value. This is likely due to too large a value of eta * lambda. Value: `%f`.', factor ) );
453453
}
454454
// Check whether we need to scale the weight vector to unity in order to avoid numerical issues...
455455
s = this._scaleFactor;

lib/node_modules/@stdlib/random/base/triangular/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function validate( a, b, c ) {
5353
return new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );
5454
}
5555
if ( !(a <= c && c <= b) ) {
56-
return new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. Value: `[%f, %f, %f]`.', 'a <= c <= b', a, b, c ) );
56+
return new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );
5757
}
5858
return null;
5959
}

lib/node_modules/@stdlib/random/iter/hypergeometric/lib/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ var format = require( '@stdlib/string/format' );
5252
* @throws {TypeError} first argument must be a nonnegative integer
5353
* @throws {TypeError} second argument must be a nonnegative integer
5454
* @throws {TypeError} third argument must be a nonnegative integer
55-
* @throws {RangeError} `n` must be less than or equal to `N`
56-
* @throws {RangeError} `K` must be less than or equal to `N`
55+
* @throws {RangeError} number of draws must be less than or equal to the population size
56+
* @throws {RangeError} subpopulation size must be less than or equal to the population size
5757
* @throws {TypeError} options argument must be an object
5858
* @throws {TypeError} must provide valid options
5959
* @throws {Error} must provide a valid state
@@ -89,10 +89,10 @@ function iterator( N, K, n, options ) {
8989
throw new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );
9090
}
9191
if ( n > N ) {
92-
throw new RangeError( format( 'invalid argument. `n` must be less than or equal to `N`. Value: `%u`.', n ) );
92+
throw new RangeError( format( 'invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.', n ) );
9393
}
9494
if ( K > N ) {
95-
throw new RangeError( format( 'invalid argument. `K` must be less than or equal to `N`. Value: `%u`.', K ) );
95+
throw new RangeError( format( 'invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.', K ) );
9696
}
9797
if ( arguments.length > 3 ) {
9898
if ( !isObject( options ) ) {

lib/node_modules/@stdlib/random/iter/triangular/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function iterator( a, b, c, options ) {
8989
throw new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );
9090
}
9191
if ( !(a <= c && c <= b) ) {
92-
throw new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. Value: `[%f, %f, %f]`.', 'a <= c <= b', a, b, c ) );
92+
throw new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );
9393
}
9494
if ( arguments.length > 3 ) {
9595
if ( !isObject( options ) ) {

lib/node_modules/@stdlib/random/streams/triangular/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function RandomStream( a, b, c, options ) {
247247
throw new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );
248248
}
249249
if ( !(a <= c && c <= b) ) {
250-
throw new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. Value: `[%f, %f, %f]`.', 'a <= c <= b', a, b, c ) );
250+
throw new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );
251251
}
252252
opts = copy( DEFAULTS );
253253
if ( arguments.length > 3 ) {

lib/node_modules/@stdlib/stats/base/dists/arcsine/ctor/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function Arcsine() {
142142
throw new TypeError( format( 'invalid argument. Maximum support must be a number. Value: `%s`.', b ) );
143143
}
144144
if ( a >= b ) {
145-
throw new RangeError( format( 'invalid arguments. Minimum support must be less than maximum support. Value: `%f, %f`.', a, b ) );
145+
throw new RangeError( format( 'invalid arguments. Minimum support must be less than maximum support. Value: `(%f, %f)`.', a, b ) );
146146
}
147147
} else {
148148
a = 0.0;

lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/ctor/lib/ctor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function DiscreteUniform() {
152152
throw new TypeError( format( 'invalid argument. Maximum support must be an integer. Value: `%s`.', b ) );
153153
}
154154
if ( a > b ) {
155-
throw new RangeError( format( 'invalid arguments. Minimum support must be less than or equal to maximum support. Value: `%d, %d`.', a, b ) );
155+
throw new RangeError( format( 'invalid arguments. Minimum support must be less than or equal to maximum support. Value: `(%d, %d)`.', a, b ) );
156156
}
157157
} else {
158158
a = 0;

lib/node_modules/@stdlib/stats/base/dists/uniform/ctor/lib/ctor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function Uniform() {
153153
throw new TypeError( format( 'invalid argument. Maximum support must be a number. Value: `%s`.', b ) );
154154
}
155155
if ( a >= b ) {
156-
throw new RangeError( format( 'invalid arguments. Minimum support must be less than maximum support. Value: `%f, %f`.', a, b ) );
156+
throw new RangeError( format( 'invalid arguments. Minimum support must be less than maximum support. Value: `(%f, %f)`.', a, b ) );
157157
}
158158
} else {
159159
a = 0.0;

lib/node_modules/@stdlib/stats/chi2test/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function chi2test( x, options ) {
8484
x = array( x );
8585
}
8686
if ( !isMatrixLike( x ) ) {
87-
throw new TypeError( format( 'invalid argument. First argument must be an array of arrays or ndarray-like object with dimension two. Value: `%s`.', x ) );
87+
throw new TypeError( format( 'invalid argument. First argument must be an array of arrays or a two-dimensional ndarray-like object. Value: `%s`.', x ) );
8888
}
8989
if ( !isNonNegativeIntegerArray( x.data ) ) {
9090
throw new TypeError( format( 'invalid argument. First argument must contain nonnegative integers. Value: `%s`.', x ) );

0 commit comments

Comments
 (0)