Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing error

  • Loading branch information...
commit 59369f7292341d8ff24eb67223f50e4e4f0b986a 1 parent fc3e50c
@andrerod andrerod authored
View
2  lib/services/core/servicebussettings.js
@@ -127,7 +127,7 @@ ServiceBusSettings.createFromConnectionString = function (connectionString) {
try {
return ServiceBusSettings.createFromSettings(tokenizedSettings);
} catch (e) {
- if (typeof e === 'NoMatchError') {
+ if (e instanceof ServiceSettings.NoMatchError) {
// Replace no match settings exception by no match connection string one.
ServiceSettings.noMatchConnectionString(connectionString);
} else {
View
2  lib/services/core/servicemanagementsettings.js
@@ -115,7 +115,7 @@ ServiceManagementSettings.createFromConnectionString = function (connectionStrin
try {
return ServiceManagementSettings.createFromSettings(tokenizedSettings);
} catch (e) {
- if (typeof e === 'NoMatchError') {
+ if (e instanceof ServiceSettings.NoMatchError) {
// Replace no match settings exception by no match connection string one.
ServiceSettings.noMatchConnectionString(connectionString);
} else {
View
12 lib/services/core/servicesettings.js
@@ -13,6 +13,7 @@
* limitations under the License.
*/
+var ut = require('util');
var util = require('../../util/util');
var _ = require('underscore');
@@ -20,8 +21,15 @@ var ConnectionStringParser = require('./connectionstringparser');
exports = module.exports;
-function NoMatchError () { }
-NoMatchError.prototype = new Error();
+var NoMatchError = function (msg, constr) {
+ Error.captureStackTrace(this, constr || this)
+ this.message = msg || 'Error'
+}
+
+ut.inherits(NoMatchError, Error)
+NoMatchError.prototype.name = 'NoMatchError'
+
+exports.NoMatchError = NoMatchError;
/**
* Throws an exception if the connection string format does not match any of the
View
2  lib/services/core/storageservicesettings.js
@@ -277,7 +277,7 @@ StorageServiceSettings.createFromConnectionString = function (connectionString)
try {
return StorageServiceSettings.createFromSettings(tokenizedSettings);
} catch (e) {
- if (typeof e === 'NoMatchError') {
+ if (e instanceof ServiceSettings.NoMatchError) {
// Replace no match settings exception by no match connection string one.
ServiceSettings.noMatchConnectionString(connectionString);
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.