Skip to content

Commit 07b9d84

Browse files
committed
Transform error messages
1 parent 9a6f2d8 commit 07b9d84

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;
2424
var defineProperty = require( '@stdlib/utils-define-property' );
2525
var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );
26-
var format = require( '@stdlib/string-format' );
26+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2727
var toStr = require( './tostring.js' );
2828
var toJSON = require( './tojson.js' );
2929

@@ -47,13 +47,13 @@ var toJSON = require( './tojson.js' );
4747
*/
4848
function Complex128( real, imag ) {
4949
if ( !( this instanceof Complex128 ) ) {
50-
throw new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );
50+
throw new TypeError( format('null0G') );
5151
}
5252
if ( !isNumber( real ) ) {
53-
throw new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );
53+
throw new TypeError( format( 'null3e', real ) );
5454
}
5555
if ( !isNumber( imag ) ) {
56-
throw new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );
56+
throw new TypeError( format( 'null3f', imag ) );
5757
}
5858
defineProperty( this, 're', {
5959
'configurable': false,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"dependencies": {
4242
"@stdlib/assert-is-number": "^0.2.2",
4343
"@stdlib/complex-float32-ctor": "^0.0.2",
44-
"@stdlib/string-format": "^0.2.2",
44+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4545
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
4646
"@stdlib/utils-define-property": "^0.2.4",
4747
"@stdlib/utils-library-manifest": "^0.2.2",

0 commit comments

Comments
 (0)