Skip to content

Commit

Permalink
Added a log
Browse files Browse the repository at this point in the history
As noted by @diasdavid in #130 (comment)
  • Loading branch information
RichardLitt committed Jan 3, 2016
1 parent b69a54d commit 5a4fb8b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/scripts/utils/localStorage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import _ from 'lodash'
import Debug from 'debug'

const debug = Debug('ipfs:utils:LocalStorage')

// Utility to make interacting with localstorage less painful.
var ls = process.browser && window.localStorage
Expand Down Expand Up @@ -30,11 +33,13 @@ function doOperation (op) {
if (op === 'getItem') {
try {
result = JSON.parse(result)
} catch (e) {}
} catch (e) {
debug('Unable to parse result as json. Message: %s', e.message)
}
}

return result
} catch (e) {
console.warn('LocalStorage error: ' + e.message)
console.warn(e.message)
}
}

0 comments on commit 5a4fb8b

Please sign in to comment.