Improve error message on connector init error
This commit is contained in:
parent
dd4530cad6
commit
9dcf30efe9
|
@ -327,13 +327,22 @@ DataSource.prototype.setup = function (name, settings) {
|
|||
|
||||
}.bind(this);
|
||||
|
||||
if ('function' === typeof connector.initialize) {
|
||||
// Call the async initialize method
|
||||
connector.initialize(this, postInit);
|
||||
} else if ('function' === typeof connector) {
|
||||
// Use the connector constructor directly
|
||||
this.connector = new connector(this.settings);
|
||||
postInit();
|
||||
try {
|
||||
if ('function' === typeof connector.initialize) {
|
||||
// Call the async initialize method
|
||||
connector.initialize(this, postInit);
|
||||
} else if ('function' === typeof connector) {
|
||||
// Use the connector constructor directly
|
||||
this.connector = new connector(this.settings);
|
||||
postInit();
|
||||
}
|
||||
} catch(err) {
|
||||
if (err.message) {
|
||||
err.message = 'Cannot initialize connector ' +
|
||||
JSON.stringify(connector.name || name) + ': ' +
|
||||
err.message;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue