sequelize / sequelize-auto

Automatically generate bare sequelize models from your database.
2.88k stars 521 forks source link

allow catching errors from SequelizeAuto.run() #645

Open hallelk opened 1 year ago

hallelk commented 1 year ago

I've been using SequelizeAuto in a CLI, and I'm getting a connection error printed every once in a while but it is not thrown as an error.

try {  
   var auto = new SequelizeAuto(config.db_name, config.user, config.password, config);  
   await auto.run().catch(err => {throw "failed generating model"});  
} catch(err) {  
   // never gets here, even when I see an error printed  
}