不要怂,就是干,撸起袖子干!

Commit 9ba5f3c2 by Sushant

fix(sqlite): simplify connection error handling

1 parent 4cc48a0a
Showing with 1 additions and 4 deletions
...@@ -58,10 +58,7 @@ class ConnectionManager extends AbstractConnectionManager { ...@@ -58,10 +58,7 @@ class ConnectionManager extends AbstractConnectionManager {
this.sequelize.options.storage || this.sequelize.options.host || ':memory:', this.sequelize.options.storage || this.sequelize.options.host || ':memory:',
options.readWriteMode || this.lib.OPEN_READWRITE | this.lib.OPEN_CREATE, // default mode options.readWriteMode || this.lib.OPEN_READWRITE | this.lib.OPEN_CREATE, // default mode
err => { err => {
if (err) { if (err) return reject(new sequelizeErrors.ConnectionError(err));
if (err.code === 'SQLITE_CANTOPEN') return reject(new sequelizeErrors.ConnectionError(err));
return reject(new sequelizeErrors.ConnectionError(err));
}
debug(`connection acquired ${options.uuid}`); debug(`connection acquired ${options.uuid}`);
resolve(this.connections[options.inMemory || options.uuid]); resolve(this.connections[options.inMemory || options.uuid]);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!