I was trying to run createTopicIfNotExists and incorrectly typed in my endpoint and key combination so that my service bus object was invalid.
When I attempt to run createTopicIfNotExists, an unhandled error is thrown from within the service bus code:
C:\src\scratch\azuresdk\node_modules\azure\lib\services\core\serviceclient.js:210
finalRequestOptions.body = body.outputData;
^
TypeError: Cannot set property 'body' of null
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\core\serviceclient.js:210:34
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\core\serviceclient.js:264:7
at ServiceBusService.filter (C:\src\scratch\azuresdk\node_modules\azure\lib\services\core\serviceclient.js:534:7)
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\core\serviceclient.js:261:10
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\core\servicebusserviceclient.js:104:5
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\serviceBus\wrap.js:69:5
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\serviceBus\wraptokenmanager.js:76:5
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\serviceBus\wrapservice.js:98:7
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\core\serviceclient.js:538:11
at C:\src\scratch\azuresdk\node_modules\azure\lib\services\serviceBus\wrapservice.js:101:5
Repro code:
var azure = require('azure');
// Succeeds.
var serviceBusService = azure.createServiceBusService('servicebus-test', 'ThisIsMykey');
// fails, but the error argument is not ever read by either code path.
serviceBusService.createTopicIfNotExists('MobileServicesTopic', function(error){
if(!error){
// Topic was created or exists
console.log("The topic was created or already exists");
}
else {
console.log("There was an error creating the topic", error);
}
});
I would expect an error to be passed into my callback function letting me know that my configuration is incorrect instead of throwing this error which is only catchable with a global error handler.
Test estimate: 1
I was trying to run createTopicIfNotExists and incorrectly typed in my endpoint and key combination so that my service bus object was invalid.
When I attempt to run createTopicIfNotExists, an unhandled error is thrown from within the service bus code:
Repro code:
I would expect an error to be passed into my callback function letting me know that my configuration is incorrect instead of throwing this error which is only catchable with a global error handler.