Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom resolver not included in error responses #345

Closed
MartinKolarik opened this issue Apr 22, 2023 · 4 comments · Fixed by jsdelivr/globalping-probe#140
Closed

Custom resolver not included in error responses #345

MartinKolarik opened this issue Apr 22, 2023 · 4 comments · Fixed by jsdelivr/globalping-probe#140
Assignees
Labels

Comments

@MartinKolarik
Copy link
Member

MartinKolarik commented Apr 22, 2023

When a measurement is created with a custom resolver set but fails with an error, the resolver is not sent back in the response:

 "result": {
        "status": "failed",
        "statusCodeName": null,
        "statusCode": null,
        "rawOutput": "Private IP ranges are not allowed",
        "answers": [],
        "timings": {
          "total": 0
        },
        "resolver": null <- this should reflect the user's value
      }

Tested with DNS but may affect other types too.

@alexey-yarmosh
Copy link
Member

In successful dns results resolver comes from the parsed result of a command, not from the user input. So if error happens before we parsed the response (https://github.com/jsdelivr/globalping-probe/blob/master/src/command/dns-command.ts#L132-L145) there is no resolver value to put to the result. We can use resolver from the user input in that case, but we will mix two sources in one field.

Another option is to set resolver when it was parsed and available (e.g. in case of "Private IP ranges are not allowed") and leave null value when it is not.

@MartinKolarik
Copy link
Member Author

The case here was the target being private. In that case, it seems we have the info but don't use it?

@alexey-yarmosh
Copy link
Member

Yes

@MartinKolarik
Copy link
Member Author

Ok, so let's show it for cases where we have the value. It doesn't probably matter for real errors where we can't get it from the output, but here it does, because whether the target was private or may depend on the resolver used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants