particle-iot-archived / particle-dev

Particle Dev package for Atom
https://www.particle.io/dev
Apache License 2.0
183 stars 30 forks source link

Protect the main package from crashing if one of the depending packages didn't load #231

Closed suda closed 6 years ago

suda commented 7 years ago

[Enter steps to reproduce:]

  1. Clear all packages
  2. Install particle-dev package without one of the dependent packages missing (like console-panel)

Atom: 1.21.2 x64 Electron: 1.6.15 OS: Microsoft Windows Server 2016 Datacenter Thrown From: particle-dev package 0.2.1

Stack Trace

Failed to activate the particle-dev package

At Cannot read property 'isLoggedIn' of undefined

TypeError: Cannot read property 'isLoggedIn' of undefined
    at Object.updateToolbarButtons (/packages/particle-dev/lib/main.coffee:298:23)
    at Object.consumeToolBar (/packages/particle-dev/lib/main.coffee:171:6)
    at Provider.module.exports.Provider.provide (~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/service-hub/lib/provider.js:34:58)
    at ServiceHub.module.exports.ServiceHub.consume (~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/service-hub/lib/service-hub.js:50:24)
    at Package.module.exports.Package.activateServices (~/AppData/Local/atom/app-1.21.2/resources/app/src/package.js:454:81)
    at Package.module.exports.Package.activateNow (~/AppData/Local/atom/app-1.21.2/resources/app/src/package.js:256:22)
    at ~/AppData/Local/atom/app-1.21.2/resources/app/src/package.js:225:38
    at Package.module.exports.Package.measure (~/AppData/Local/atom/app-1.21.2/resources/app/src/package.js:99:21)
    at ~/AppData/Local/atom/app-1.21.2/resources/app/src/package.js:218:32
    at Package.module.exports.Package.activate (~/AppData/Local/atom/app-1.21.2/resources/app/src/package.js:215:40)
    at PackageManager.activatePackage (~/AppData/Local/atom/app-1.21.2/resources/app/src/package-manager.js:690:42)
    at ~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/settings-view/lib/package-manager.js:535:35
    at exit (~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/settings-view/lib/package-manager.js:128:22)
    at triggerExitCallback (~/AppData/Local/atom/app-1.21.2/resources/app/src/buffered-process.js:338:17)
    at ChildProcess.<anonymous> (~/AppData/Local/atom/app-1.21.2/resources/app/src/buffered-process.js:368:17)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

Commands

  2x -8:25.4.0 core:confirm (input.hidden-input)

Non-Core Packages

console-panel 0.3.0 
particle-dev 0.2.1 
particle-dev-cloud-functions 0.2.0 
particle-dev-cloud-variables 0.2.0 
particle-dev-complete 1.0.2 
particle-dev-libraries 0.2.24 
particle-dev-profiles 0.2.3 
tool-bar 1.1.0