Closed kumavis closed 6 years ago
only return a promise if no callback provided - otherwise instrument the promise so it doesnt throw unhandled rejections
this is important because if you dont use the promise (as it is not used in ethjs-query) it will cause an "unhandled promise rejection" if it errors
ethjs-query
this PR avoids this problem by instrumenting the internal promise when a callback is provided.
Note: return undefined; is a result of your linters strange fetishes
return undefined;
While this is technically a bug fix, I reccomend releasing it under a major version bump
Coverage remained the same at 100.0% when pulling a7a7804c70551827de5ed15d42f9550c4aadba1f on kumavis:master into cb04ea6a1b930b90c7e27e88d00bfbfc3ed76c7e on ethjs:master.
only return a promise if no callback provided - otherwise instrument the promise so it doesnt throw unhandled rejections
this is important because if you dont use the promise (as it is not used in
ethjs-query
) it will cause an "unhandled promise rejection" if it errorsthis PR avoids this problem by instrumenting the internal promise when a callback is provided.
Note:
return undefined;
is a result of your linters strange fetishes