Skip to content

Commit

Permalink
feat: complete callback error catch
Browse files Browse the repository at this point in the history
  • Loading branch information
徐博 committed Aug 9, 2021
1 parent 10d728b commit f93e02a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/db_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ async function getItemFromDB (
) {
if (db.objectStoreNames.contains(tableName)) {
const trans: any = db.transaction(tableName, 'readonly');
const table = trans.objectStore(tableName);
try {
const table = trans.objectStore(tableName);
const itemInTable = ((await table.get(
primaryKeyValue
)) as any) as ItemInTable;
Expand Down Expand Up @@ -390,8 +390,8 @@ export async function getItemsInRange (
// Do nothing if table does not exist.
} else {
const trans = db.transaction(tableName, 'readonly');
const table = trans.objectStore(tableName);
try {
const table = trans.objectStore(tableName);
if (!indexRange) {
// Get all items in table if indexRange is undefined
let wrappedItems = await table.getAll();
Expand Down

0 comments on commit f93e02a

Please sign in to comment.