Skip to content

Commit 82dea00

Browse files
committed
feat!: rename error codes
This commit adds a `SLICE_` prefix to error codes to help distinguish the relevant error codes from other errors across the code base which might have similar error names. This namespacing convention follows Node.js core conventions. BREAKING CHANGE: rename error codes To migrate, if users were checking for particular error codes, they should add the `SLICE_` prefix to their checks.
1 parent d08b3c1 commit 82dea00

File tree

18 files changed

+33
-33
lines changed

18 files changed

+33
-33
lines changed

lib/node_modules/@stdlib/slice/base/normalize-multi-slice/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ var MultiSlice = require( '@stdlib/slice/multi' );
106106

107107
var s1 = new MultiSlice( new Slice( -20, 20, 1 ) );
108108
var s2 = normalizeMultiSlice( s1, [ 10 ], true );
109-
// returns { 'code': 'ERR_OUT_OF_BOUNDS' }
109+
// returns { 'code': 'ERR_SLICE_OUT_OF_BOUNDS' }
110110
```
111111

112112
A returned error object may have one of the following error codes:
113113

114-
- **ERR_OUT_OF_BOUNDS**: a slice exceeds index bounds.
114+
- **ERR_SLICE_OUT_OF_BOUNDS**: a slice exceeds index bounds.
115115

116116
</section>
117117

lib/node_modules/@stdlib/slice/base/normalize-multi-slice/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
A returned error object may have one of the following error codes:
1313

14-
- ERR_OUT_OF_BOUNDS: a slice exceeds index bounds.
14+
- ERR_SLICE_OUT_OF_BOUNDS: a slice exceeds index bounds.
1515

1616
Parameters
1717
----------

lib/node_modules/@stdlib/slice/base/normalize-multi-slice/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface ErrorObject {
3030
/**
3131
* Error code.
3232
*/
33-
code: 'ERR_OUT_OF_BOUNDS';
33+
code: 'ERR_SLICE_OUT_OF_BOUNDS';
3434
}
3535

3636
/**

lib/node_modules/@stdlib/slice/base/normalize-multi-slice/lib/error_out_of_bounds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
function error() {
3030
return {
31-
'code': 'ERR_OUT_OF_BOUNDS'
31+
'code': 'ERR_SLICE_OUT_OF_BOUNDS'
3232
};
3333
}
3434

lib/node_modules/@stdlib/slice/base/normalize-multi-slice/test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ tape( 'in strict mode, the function returns an error object when a slice exceeds
296296
new MultiSlice( -6, 12, -10, 2 )
297297
];
298298
expected = {
299-
'code': 'ERR_OUT_OF_BOUNDS'
299+
'code': 'ERR_SLICE_OUT_OF_BOUNDS'
300300
};
301301

302302
for ( i = 0; i < values.length; i++ ) {
@@ -327,7 +327,7 @@ tape( 'in strict mode, the function returns an error object when a slice exceeds
327327
new MultiSlice( new Slice( -30, -20, 1 ) )
328328
];
329329
expected = {
330-
'code': 'ERR_OUT_OF_BOUNDS'
330+
'code': 'ERR_SLICE_OUT_OF_BOUNDS'
331331
};
332332

333333
for ( i = 0; i < values.length; i++ ) {

lib/node_modules/@stdlib/slice/base/normalize-slice/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ When `strict` is `true`, the function returns an error object if an input slice
6868
var Slice = require( '@stdlib/slice/ctor' );
6969

7070
var s = normalizeSlice( new Slice( -20, 20, 1 ), 10, true );
71-
// returns { 'code': 'ERR_OUT_OF_BOUNDS' }
71+
// returns { 'code': 'ERR_SLICE_OUT_OF_BOUNDS' }
7272
```
7373

7474
A returned error object may have one of the following error codes:
7575

76-
- **ERR_OUT_OF_BOUNDS**: a slice exceeds index bounds.
76+
- **ERR_SLICE_OUT_OF_BOUNDS**: a slice exceeds index bounds.
7777

7878
</section>
7979

lib/node_modules/@stdlib/slice/base/normalize-slice/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
A returned error object may have one of the following error codes:
1313

14-
- ERR_OUT_OF_BOUNDS: a slice exceeds index bounds.
14+
- ERR_SLICE_OUT_OF_BOUNDS: a slice exceeds index bounds.
1515

1616
Parameters
1717
----------

lib/node_modules/@stdlib/slice/base/normalize-slice/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface ErrorObject {
2929
/**
3030
* Error code.
3131
*/
32-
code: 'ERR_OUT_OF_BOUNDS';
32+
code: 'ERR_SLICE_OUT_OF_BOUNDS';
3333
}
3434

3535
/**

lib/node_modules/@stdlib/slice/base/normalize-slice/lib/error_out_of_bounds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
function error() {
3030
return {
31-
'code': 'ERR_OUT_OF_BOUNDS'
31+
'code': 'ERR_SLICE_OUT_OF_BOUNDS'
3232
};
3333
}
3434

lib/node_modules/@stdlib/slice/base/normalize-slice/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ tape( 'in strict mode, the function returns an error object when a slice exceeds
169169
new Slice( null, -20, 1 )
170170
];
171171
expected = {
172-
'code': 'ERR_OUT_OF_BOUNDS'
172+
'code': 'ERR_SLICE_OUT_OF_BOUNDS'
173173
};
174174

175175
for ( i = 0; i < values.length; i++ ) {

0 commit comments

Comments
 (0)