You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the pingCheck() function, if the error caught is of type "undefined / null", the pingCheck() function will return an unexpected error.
Minimum reproduction code
I reproduce the bug with an MQTT MicroService, in some cases it returns an "undefined" error if the service can't connect to the server.
To reproduce the case you have to catch an exception that is not an object.
Steps to reproduce
See below, I think the resolution of the problem is simple.
Expected behavior
The expected behavior is that the exception returned by the pingCheck() function should be an instance of HealthCheckError (MicroserviceHealthIndicator class).
I think the solution is to update the isError function to not throw an exception if the given error is undefined/null.
old:
exportfunctionisError(err: any): err is Error{return!!err.message;}
new:
exportfunctionisError(err: any): err is Error{return!!err?.message;}
In addition, the verification of the existence of the error is already done in the generateError() function
if(!error){return;}
Package version
9.2.1
NestJS version
9.3.9
Node.js version
18.15.0
In which operating systems have you tested?
macOS
Windows
Linux
Other
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current behavior
In the pingCheck() function, if the error caught is of type "undefined / null", the pingCheck() function will return an unexpected error.
Minimum reproduction code
I reproduce the bug with an MQTT MicroService, in some cases it returns an "undefined" error if the service can't connect to the server.
To reproduce the case you have to catch an exception that is not an object.
Steps to reproduce
See below, I think the resolution of the problem is simple.
Expected behavior
The expected behavior is that the exception returned by the pingCheck() function should be an instance of HealthCheckError (MicroserviceHealthIndicator class).
I think the solution is to update the isError function to not throw an exception if the given error is undefined/null.
old:
new:
In addition, the verification of the existence of the error is already done in the generateError() function
Package version
9.2.1
NestJS version
9.3.9
Node.js version
18.15.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: