8000 Transform error messages · stdlib-js/ndarray-base-slice@3646cd4 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3646cd4

Browse files
committed
Transform error messages
1 parent 4b01d73 commit 3646cd4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var getStrides = require( '@stdlib/ndarray-base-strides' );
3232
var getOffset = require( '@stdlib/ndarray-base-offset' );
3333
var getOrder = require( '@stdlib/ndarray-base-order' );
3434
var getData = require( '@stdlib/ndarray-base-data-buffer' );
35-
var format = require( '@stdlib/string-format' );
35+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3636
var sliceStart = require( './slice_start.js' );
3737
var slice2strides = require( './slice_strides.js' );
3838
var empty = require( './empty.js' );
@@ -105,7 +105,7 @@ function slice( x, s, strict, writable ) {
105105

106106
// Ensure that the number of array dimensions matches the number of slices:
107107
if ( s.ndims !== ndims ) {
108-
throw new RangeError( format( 'invalid argument. Number of slice dimensions does not match the number of array dimensions. Array shape: (%s). Slice dimensions: %u.', shape.join( ',' ), s.ndims ) );
108+
throw new RangeError( format( '1jREt', shape.join( ',' ), s.ndims ) );
109109
}
110110
// Resolve the output array constructor:
111111
ctor = x.constructor;
@@ -125,7 +125,7 @@ function slice( x, s, strict, writable ) {
125125
// Check whether the slice exceeds array bounds...
126126
if ( ns.code ) {
127127
if ( strict ) {
128-
throw new RangeError( format( 'invalid argument. Slice exceeds array bounds. Array shape: (%s).', shape.join( ',' ) ) );
128+
throw new RangeError( format( '1jREz', shape.join( ',' ) ) );
129129
}
130130
// Normalize again, this time allowing for out-of-bounds indices:
131131
ns = normalizeMultiSlice( s, shape, false );

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@stdlib/slice-base-nonreduced-dimensions": "^0.2.2",
5151
"@stdlib/slice-base-normalize-multi-slice": "^0.2.2",
5252
"@stdlib/slice-base-shape": "^0.2.2",
53-
"@stdlib/string-format": "^0.2.2",
53+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
5454
"@stdlib/types": "^0.4.3",
5555
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
5656
},

0 commit comments

Comments
 (0)
0