From 3572866bd3795129791be22fbe3bc334e54e3d00 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 20 Nov 2014 04:39:58 -0500 Subject: [PATCH] fix(storage) if to much data -> exeption --- lib/client/storage.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/client/storage.js b/lib/client/storage.js index b3ca9a17..f65f6e12 100644 --- a/lib/client/storage.js +++ b/lib/client/storage.js @@ -61,15 +61,17 @@ var Util, DOM; * записываем данные в него */ this.set = function(name, data, callback) { - var str, ret = Allowed && name; + var str, error; if (Util.type.object(data)) str = Util.json.stringify(data); if (Allowed && name) - localStorage.setItem(name, str || data); + error = Util.exec.try(function() { + localStorage.setItem(name, str || data); + }); - Util.exec(callback, null, ret); + Util.exec(callback, error); return this; },