Skip to content

Commit 91b5a80

Browse files
committed
Transform error messages
1 parent ec50093 commit 91b5a80

File tree

4 files changed

+112
-117
lines changed

4 files changed

+112
-117
lines changed

lib/from_iterator.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
2424
var isComplexLike = require( '@stdlib/assert-is-complex-like' );
2525
var realf = require( '@stdlib/complex-float32-real' );
2626
var imagf = require( '@stdlib/complex-float32-imag' );
27-
var format = require( '@stdlib/string-format' );
27+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2828

2929

3030
// MAIN //
@@ -53,7 +53,7 @@ function fromIterator( it ) {
5353
} else if ( isComplexLike( z ) ) {
5454
out.push( realf( z ), imagf( z ) );
5555
} else {
56-
return new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );
56+
return new TypeError( format( '00R24', z ) );
5757
}
5858
}
5959
return out;

lib/from_iterator_map.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
2424
var isComplexLike = require( '@stdlib/assert-is-complex-like' );
2525
var realf = require( '@stdlib/complex-float32-real' );
2626
var imagf = require( '@stdlib/complex-float32-imag' );
27-
var format = require( '@stdlib/string-format' );
27+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2828

2929

3030
// MAIN //
@@ -58,7 +58,7 @@ function fromIteratorMap( it, clbk, thisArg ) {
5858
} else if ( isComplexLike( z ) ) {
5959
out.push( realf( z ), imagf( z ) );
6060
} else {
61-
return new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );
61+
return new TypeError( format( '00R25', z ) );
6262
}
6363
}
6464
return out;

0 commit comments

Comments
 (0)