Skip to content

Commit

Permalink
fix: throw read error on read error
Browse files Browse the repository at this point in the history
Fixes #299
  • Loading branch information
achingbrain committed Apr 9, 2024
1 parent 2e8f8db commit d1361d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/datastore-idb/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class IDBDatastore extends BaseDatastore {
try {
await this.db.delete(this.location, key.toString())
} catch (err: any) {
throw Errors.dbWriteFailedError(err)
throw Errors.dbDeleteFailedError(err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/datastore-level/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class LevelDatastore extends BaseDatastore {
throw Errors.notFoundError(err)
}

throw Errors.dbWriteFailedError(err)
throw Errors.dbReadFailedError(err)

Check warning on line 121 in packages/datastore-level/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/datastore-level/src/index.ts#L121

Added line #L121 was not covered by tests
}
return data
}
Expand Down

0 comments on commit d1361d2

Please sign in to comment.