Azure / Azure/azure-iot-hub-node
infinite recursion in getErrorName
- Dominant language
- TypeScript
- Stars
- 3
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
On:
- newest azure-iothub version: 1.16.5.
- Node.js: v20
Log:
```
{"message":"Maximum call stack size exceeded","stack":"RangeError: Maximum call stack size exceeded
at getErrorName (/myApp/node_modules/azure-iothub/dist/common-amqp/amqp_common_errors.js:137:5)
at getErrorName (/myApp/node_modules/azure-iothub/dist/common-amqp/amqp_common_errors.js:144:34)
at getErrorName (/myApp/node_modules/azure-iothub/dist/common-amqp/amqp_common_errors.js:144:34)
at getErrorName (/myApp/node_modules/azure-iothub/dist/common-amqp/amqp_common_errors.js:144:34)
at getErrorName (/myApp/node_modules/azure-iothub/dist/common-amqp/amqp_common_errors.js:144:34)
...
many more
...
at getErrorName (/myApp/node_modules/azure-iothub/dist/common-amqp/amqp_common_errors.js:144:34)",
"type":"RangeError"}"},
```
This is the first time I've encountered this error. It occurred simultaneously on two k8s pods, no additional logs were captured. It appears to be caused by a recursive call in the getErrorName function (?).
```js
function getErrorName(err) {
if (err) {
if (err.condition) {
return amqp error(${err.condition});
}
else if ([err.name](http://err.name/)) {
let name = javacript error(${err});
if (err.amqpError) {
name += (from ${getErrorName(err.amqpError)});
}
return name;
}
else {
return 'unknown error type';
}
}
else {
return 'error is falsy';
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.