This repository was archived by the owner on Sep 9, 2021. It is now read-only.
File tree 2 files changed +6
-7
lines changed 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const errcode = require ( 'err-code' )
4
4
5
- module . exports . ERR_DB_CANNOT_OPEN = ( err ) => {
5
+ module . exports . dbOpenFailedError = ( err ) => {
6
6
err = err || new Error ( 'Cannot open database' )
7
- return errcode ( err , 'ERR_CANNOT_OPEN_DB ' )
7
+ return errcode ( err , 'ERR_DB_OPEN_FAILED ' )
8
8
}
9
9
10
- module . exports . ERR_DB_DELETE_FAILED = ( err ) => {
10
+ module . exports . dbDeleteFailedError = ( err ) => {
11
11
err = err || new Error ( 'Delete failed' )
12
12
return errcode ( err , 'ERR_DB_DELETE_FAILED' )
13
13
}
14
14
15
- module . exports . ERR_DB_WRITE_FAILED = ( err ) => {
15
+ module . exports . dbWriteFailedError = ( err ) => {
16
16
err = err || new Error ( 'Write failed' )
17
17
return errcode ( err , 'ERR_DB_WRITE_FAILED' )
18
18
}
19
19
20
- module . exports . ERR_NOT_FOUND = ( err ) => {
20
+ module . exports . notFoundError = ( err ) => {
21
21
err = err || new Error ( 'Not Found' )
22
22
return errcode ( err , 'ERR_NOT_FOUND' )
23
23
}
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ const Key = require('./key')
12
12
13
13
// Errors
14
14
const Errors = require ( './errors' )
15
- const ERR_NOT_FOUND = Errors . ERR_NOT_FOUND
16
15
17
16
class MemoryDatastore {
18
17
/* :: data: {[key: string]: Buffer} */
@@ -38,7 +37,7 @@ class MemoryDatastore {
38
37
}
39
38
40
39
if ( ! exists ) {
41
- return callback ( ERR_NOT_FOUND ( ) )
40
+ return callback ( Errors . notFoundError ( ) )
42
41
}
43
42
44
43
callback ( null , this . data [ key . toString ( ) ] )
You can’t perform that action at this time.
0 commit comments