Skip to content

Commit

Permalink
storage unavailable err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Moumita Mandal committed Jan 3, 2022
1 parent 9a0e596 commit fa742f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/storage/storage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable class-methods-use-this */
import AES from "crypto-js/aes";
import Utf8 from "crypto-js/enc-utf8";
import logger from "../logUtil";
Expand All @@ -13,7 +14,7 @@ const defaults = {
page_storage_init_referrer: "rl_page_init_referrer",
page_storage_init_referring_domain: "rl_page_init_referring_domain",
prefix: "RudderEncrypt:",
key: "Rudder"
key: "Rudder",
};

/**
Expand All @@ -34,6 +35,10 @@ class Storage {
if (Store.enabled) {
this.storage = Store;
}

if (!this.storage) {
throw Error("Could not initialize the SDK :: no storage is available");
}
}

options(options = {}) {
Expand Down

0 comments on commit fa742f0

Please sign in to comment.