pinittome / pinitto.me

Main repo for pinitto.me open source corkboard
https://pinitto.me
Apache License 2.0
64 stars 14 forks source link

Crash on database connection failure #111

Open arthurlutz opened 10 years ago

arthurlutz commented 10 years ago

Maybe the app should display an error message instead of crashing

/home/arthur/local/pinitto.me/src/database.js:15
    if (error) throw Error(error)
                     ^
Error: Error: connection closed
    at Error (<anonymous>)
    at /home/arthur/local/pinitto.me/src/database.js:15:22
    at /home/arthur/local/pinitto.me/node_modules/mongodb/lib/mongodb/db.js:229:16
    at null.<anonymous> (/home/arthur/local/pinitto.me/node_modules/mongodb/lib/mongodb/connection/server.js:606:7)
    at EventEmitter.emit (events.js:92:17)
    at null.<anonymous> (/home/arthur/local/pinitto.me/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:154:15)
    at EventEmitter.emit (events.js:98:17)
    at Socket.<anonymous> (/home/arthur/local/pinitto.me/node_modules/mongodb/lib/mongodb/connection/connection.js:491:12)
    at Socket.EventEmitter.emit (events.js:95:17)
    at TCP.close (net.js:466:12)
lloydwatkin commented 10 years ago

It should recover itself from this. If not this is something I'll look to fix in the next version. Thanks!