error-shelter
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -13,5 +13,12 @@ // errorShelter.js - Extends the native Error method and stores errors into localStorage obj | ||
// initialize an empty object in localStorage | ||
localStorage.setItem(config.nameSpace, JSON.stringify({errors:[]})); | ||
var initializeEmptyStorage = function () { | ||
localStorage.setItem(config.nameSpace, JSON.stringify({errors:[]})); | ||
}; | ||
// check for existing errorShelter in storage and if non exists initialize empty | ||
if (!localStorage.getItem(config.nameSpace)) { | ||
initializeEmptyStorage(); | ||
} | ||
var nativeError = Error; | ||
@@ -37,3 +44,4 @@ | ||
}, | ||
'stack' : e.stack | ||
'stack' : e.stack, | ||
'options' : {} | ||
}); | ||
@@ -64,5 +72,6 @@ | ||
window.Error[config.nameSpace] = { | ||
getStorage : getStorage | ||
getStorage : getStorage, | ||
emptyStorage : initializeEmptyStorage | ||
}; // makes these methods accessible on the Error method | ||
})(); |
{ | ||
"name": "error-shelter", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "frontend error catch and storage utility for JS apps.", | ||
@@ -5,0 +5,0 @@ "main": "errorShelter.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5126
73