Permalink
Browse files

Merge branch 'connectionStrings' into completeconnectionstring

  • Loading branch information...
Andre Rodrigues
Andre Rodrigues committed Oct 10, 2012
2 parents cc4f916 + 0967bcc commit 022c583e7abfc751cc9e108c403ebc2a19b9b5c6
@@ -145,7 +145,7 @@ ConnectionStringParser.prototype._extractString = function (quote) {
if (this._pos === this._value.length) {
// Runaway string.
- throw new Error('Invalid string');
+ throw new Error('Unterminated string starting at position ' + firstPos);
}
return this._value.substring(firstPos, this._pos++);
@@ -159,7 +159,7 @@ ConnectionStringParser.prototype._extractString = function (quote) {
ConnectionStringParser.prototype._skipOperator = function (operatorChar) {
if (this._value[this._pos] != operatorChar) {
// Character was expected.
- throw new Error('Character not expected ' + operatorChar);
+ throw new Error('expecting ' + operatorChar + ' but instead got ' + currentChar + ' at position ' + this._pos);
}
this._pos++;
@@ -31,24 +31,24 @@ exports = module.exports = ServiceManagementService;
* Creates a new ServiceManagementService object.
*
* @constructor
-* @param {string} subscriptionId The subscription ID for the account.
-* @param {string} authentication The authentication object for the client.
-* {
-* keyfile: 'path to .pem',
-* certfile: 'path to .pem',
-* keyvalue: privatekey value,
-* certvalue: public cert value
-* }
-* @param {string} hostOptions The host options to override defaults.
-* {
-* host: 'management.core.windows.net',
-* apiversion: '2012-03-01',
-* serializetype: 'XML'
-* }
+* @param {string} subscriptionIdOrConnectionString The subscription ID for the account or the connectionString.
+* @param {string} authentication The authentication object for the client.
+* {
+* keyfile: 'path to .pem',
+* certfile: 'path to .pem',
+* keyvalue: privatekey value,
+* certvalue: public cert value
+* }
+* @param {string} hostOptions The host options to override defaults.
+* {
+* host: 'management.core.windows.net',
+* apiversion: '2012-03-01',
+* serializetype: 'XML'
+* }
*/
-function ServiceManagementService(subscriptionId, authentication, hostOptions) {
+function ServiceManagementService(subscriptionIdOrConnectionString, authentication, hostOptions) {
if (typeof subscriptionId != 'string' || subscriptionId.length === 0) {
- throw new Error('SubscriptionId is required');
+ throw new Error('A subscriptionId or a connection string is required');
}
ServiceManagementService.super_.call(this, authentication, hostOptions);

0 comments on commit 022c583

Please sign in to comment.