Permalink
Browse files

Fixing error

  • Loading branch information...
1 parent fc3e50c commit 59369f7292341d8ff24eb67223f50e4e4f0b986a Andre Rodrigues committed Oct 12, 2012
@@ -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 {
@@ -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 {
@@ -13,15 +13,23 @@
* limitations under the License.
*/
+var ut = require('util');
var util = require('../../util/util');
var _ = require('underscore');
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
@@ -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 {

0 comments on commit 59369f7

Please sign in to comment.