DnsLibs icon indicating copy to clipboard operation
DnsLibs copied to clipboard

Improve the upstream testing helper

Open sxgunchenko opened this issue 3 years ago • 0 comments

For now, we have 2 issues with the helper (ag::err_string ag::test_upstream(...)):

  1. it returns the optional error string as the result of the test
  2. it does both the validation of an upstream URL and testing if it is alive

To address these issues the following should be done:

  1. add an enum with a few error codes, like OK, INVALID_ADDRESS, and NETWORK_ERROR (maybe something else), and make the helper return the error code
  2. there are 2 options:
    • add some parameter to the helper which identifies if the health check is needed, or
    • extract the validation logic to a separate method

sxgunchenko avatar Mar 23 '21 09:03 sxgunchenko