brave / vault

Brave personal data store vault.
https://brave.com
Mozilla Public License 2.0
19 stars 18 forks source link

Create wallet undefined error on startup w/o API key #10

Closed bbondy closed 8 years ago

bbondy commented 8 years ago

Marshall ran into this create wallet id of undefined error. @KevinGrandon mentions it's probably because of a missing API key. Posting to handle this more gracefully.

% gulp run
[22:33:35] Using gulpfile ~/Desktop/vault/gulpfile.js
[22:33:35] Starting 'run'...
[22:33:35] Finished 'run' after 1.25 ms
[22:33:35] [nodemon] v1.7.0
[22:33:35] [nodemon] to restart at any time, enter `rs`
[22:33:35] [nodemon] watching: src/**/*.js src/controllers/**/*.js
[22:33:35] [nodemon] starting `./node_modules/.bin/babel-node src/index.js`
  index error +0ms undefined
[Error: already logged in]
  index webserver started on port +34ms 3000
  sync getting state +32s mrose17
  monk:queries user_states findOne {"userId":"mrose17"} +1ms
  sync body +4ms {}
  users registering user +1m { userId: 'mrose' }
  users created wallet +1ms { _invoke: [Function: invoke] }
  users could not create wallet +0ms [TypeError: Cannot call method 'id' of undefined]
  users new user +1ms { userId: 'mrose' }
  monk:queries users insert {"userId":"mrose"} +0ms
KevinGrandon commented 8 years ago

I think this may be ok. Looks like it's just logging it, and it's not a fatal error or anything.

https://github.com/brave/vault/blob/7c35f47edb08a1a89863821ccba8b7e4745c2b81/src/controllers/auth.js#L27

Maybe we want to add a message if we can't find a BitGo API key though and to expect these errors?

bbondy commented 8 years ago

Not a big deal but just to put a message like: users could not create wallet +0ms [No API key] Instead of: users could not create wallet +0ms [TypeError: Cannot call method 'id' of undefined]