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

Commit 3a9ee2d8 by Mick Hansen

Merge pull request #4765 from alexbooker/master

Made unsupported dialect error message clearer.
2 parents e548b2cd 5f70c51b
......@@ -202,7 +202,7 @@ var Sequelize = function(database, username, password, options) {
}
this.dialect = new Dialect(this);
} catch (err) {
throw new Error('The dialect ' + this.getDialect() + ' is not supported. ('+err+')');
throw new Error('The dialect ' + this.getDialect() + ' is not supported. Supported dialects: mariadb, mssql, mysql, postgres, and sqlite. ('+err+')');
}
this.dialect.QueryGenerator.typeValidation = options.typeValidation;
......
......@@ -57,7 +57,7 @@ describe(Support.getTestDialectTeaser('Configuration'), function() {
it('when we don\'t have a valid dialect.', function() {
expect(function() {
new Sequelize(config[dialect].database, config[dialect].username, config[dialect].password, {host: '0.0.0.1', port: config[dialect].port, dialect: undefined});
}).to.throw(Error, 'The dialect undefined is not supported.');
}).to.throw(Error, 'The dialect undefined is not supported. Supported dialects: mariadb, mssql, mysql, postgres, and sqlite.');
});
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!