Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit afab18a

Browse files
authored
fix: add error for db read failures (#146)
This is different from a not-found error
1 parent 33bd252 commit afab18a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/errors.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export function dbWriteFailedError (err?: Error): Error {
1515
return errCode(err, 'ERR_DB_WRITE_FAILED')
1616
}
1717

18+
export function dbReadFailedError (err?: Error): Error {
19+
err = err ?? new Error('Read failed')
20+
return errCode(err, 'ERR_DB_READ_FAILED')
21+
}
22+
1823
export function notFoundError (err?: Error): Error {
1924
err = err ?? new Error('Not Found')
2025
return errCode(err, 'ERR_NOT_FOUND')

0 commit comments

Comments
 (0)