Closed chourihan closed 3 years ago
Good catch, thanks for the PR. Could you add a unit test for this scenario? Does this issue exist in GetResponse as well?
On looking into SetResponse, it appears that input validation should be handled in lib/support/validateInput.js. Can you verify whether the faulty input is handled correctly in that function, and if not, fix it in that location?
On looking into SetResponse, it appears that input validation should be handled in lib/support/validateInput.js. Can you verify whether the faulty input is handled correctly in that function, and if not, fix it in that location?
@jcranendonk it does look like this is invoked before the SetResponse
constructor and is the more appropriate place to catch the error.
@jcranendonk moved the error handling to lib/support/validateInput.js
and added a couple of tests.
When creating a new
SetResponse
instance, the constructor may make calls topathSyntax.fromPath
. If the presumed path is invalid, the parser may throw an exception which since done in the constructor is uncaught. This catches those exception and emits an error on_subscribe
.