Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Commit

Permalink
Netrix: "Handle" QuotaExceededError
Browse files Browse the repository at this point in the history
According to localForage/localForage#828 (comment)
this is thrown when >1GB space is available.
  • Loading branch information
bs3vcenk committed Dec 4, 2019
1 parent ae3e2c3 commit 0584446
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Netrix/src/app/services/api.service.ts
Expand Up @@ -121,7 +121,17 @@ export class ApiService {
date,
data
};
await this.storage.set(accessId, cObject);
try {
await this.storage.set(accessId, cObject);
} catch (e) {
if (e.code === 22) {
// TODO: Handle this
console.warn('ApiService/storeInCache(): Failed to store data in cache, no space. Handling TBD.');
} else {
console.warn('ApiService/storeInCache(): Failed to store data in cache, some other error. Sending to handler.');
throw e;
}
}
}

handleErr(errorObj) {
Expand Down

0 comments on commit 0584446

Please sign in to comment.