Skip to content

Commit

Permalink
Throw a better exception when url or username and password are undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Ffrench committed Mar 2, 2016
1 parent 4798b84 commit a67cfcb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/cloudant.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ function Cloudant(settings, ds) {
Connector.call(this, 'cloudant', settings);
this.debug = settings.debug || debug.enabled;
this.dataSource = ds;
if (!settings.url && (!settings.username || !settings.password)) {
throw new Error('Invalid settings: "url" OR "username" AND "password" required');
}
this.creds = settings.url || {
account: settings.username,
password: settings.password,
Expand Down

0 comments on commit a67cfcb

Please sign in to comment.