pact-js icon indicating copy to clipboard operation
pact-js copied to clipboard

[Enhance] Better provider base url format error log

Open luchillo17 opened this issue 6 years ago • 1 comments

Software versions

Expected behaviour

Expected to see an error more descriptive like provider-base-url format not allowed, expected format is /^https?:\/\/.*:\d*$/, this way errors with the provider base url format would be easier to debug.

Actual behaviour

While using 0.0.0.0:3001 as provider-base-url we got the following error, spent all day in slack chat to understand what was wrong, had to change it to http://localhost:3001.

image

Steps to reproduce

Just use 0.0.0.0 as provider base url with any port you want, with a localhost based api to verify, should get ENOTFOUND ${PORT} with little to no explanation about what's wrong.

luchillo17 avatar Jun 09 '19 00:06 luchillo17

Thanks for raising as discussed. We should pre-validate the correct format as part of setup. Marking as ready.

mefellows avatar Jun 09 '19 01:06 mefellows